CreateSession redirects

Feb 4, 2008 at 12:04 AM

Im trying out the Web sample app, but getting a problem at CreateSession. The call does not seem to return, instead it redirects to the callback URL so the session variables never get set.
Any ideas on what Im doing wrong?

Best regards,

Code snippet from the sample:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

' ApplicationKey and Secret are acquired when you sign up for
_fbService.ApplicationKey = "xxx"
_fbService.Secret = "yyy"
_fbService.IsDesktopApplication = False

Dim sessionKey As String = TryCast(Session("facebooksessionkey"), String)
Dim userId As String = TryCast(Session("facebook_userId"), String)

' When the user uses the facebook login page, the redirect back here will will have the auth_token in the query params
Dim authToken As String = Request.QueryString("auth_token")

' We have already established a session on behalf of this user
If (Not String.IsNullOrEmpty(sessionKey)) Then
_fbService.SessionKey = sessionKey
_fbService.UserId = userId
' This will be executed when facebook login redirects to our page
ElseIf (Not String.IsNullOrEmpty(authToken)) Then
'The code after this point
'is never executed
Session("facebooksessionkey") = _fbService.SessionKey
Session("facebook_userId") = _fbService.UserId
Session("facebooksessionexpires") = _fbService.SessionExpires
' Need to login
Response.Redirect("" & _fbService.ApplicationKey & "&v=1.0")
End If
Feb 4, 2008 at 6:16 AM
I am having the same problem also. When I try to debug it, I kept on getting the exception error "The underlying connection was closed: An unexpected error occurred on a receive.". I tried locally (debug) as well as place it in another different IP, I am still getting the same exception. I am currently using version 1.6.
Feb 4, 2008 at 6:53 AM
I'm getting the same error as Daren and I am also using v 1.6. Could be an endless redirect loop caused by CreateSession when your Callback URL contains the CreateSession call.
Strange if this is a bug, since everyone new to Facebook Web interface would run into it.
I hope there is a simple explanation, something misconfigured!

Best regards,
Feb 4, 2008 at 4:23 PM
I have same problem from this morning (my application was working last week). I tryed ver 1.3, ver 1.5 and ver1.6 but still got same error.
Does Facebook change something?
Feb 5, 2008 at 1:55 AM
I am still having the same problem today. Any idea what is going on? or how should I go about to resolve this problem? Any help is really appreciated.

Feb 5, 2008 at 6:10 AM
Me to. Not solved yet and no hint.
User Elmar has logged Issue # 9279 "Authentication broken" under the Issue Tracker tab.
I think we have the same problem. Vote for tha issue to raise the urgency for some guru in the development team to fix it.
Here is an URL to the issue-page:

Best regards,
Feb 5, 2008 at 9:23 PM
Hi again!

For some reason it seems to work today!
I haven't changed the code.

Best regards,