facebook connect VB- Session key invalid

Jan 11, 2010 at 10:59 AM

i am using  facebook asp.net toolkit to implement facebook connect for my site.

toolkit- http://facebooktoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=35534

MY CODE -

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        _connectSession = New ConnectSession(APPLICATION_KEY, SECRET_KEY)

        If Not _connectSession.IsConnected Then
        
            lblStatus.Text = "Please sign-in with Facebook."
        Else
            _facebookAPI = New Api(_connectSession)
            Dim user As user = _facebookAPI.Users.GetInfo()

            If Not Page.IsPostBack Then
                lblStatus.Text = String.Format("Signed in as {0} {1} {2} {3}", user.first_name, user.last_name,)
            End If
        End If

    End Sub

problem-1)

above code opens up a popup, ask me to login in faceook and gives me my first name and last name. Now in side tab I open facebook, it directly opens my home page .I get logged out and then refresh my webPage where I was trying to implement facebook connect. it gives following error

Facebook.Utility.FacebookException: Session key invalid or no longer valid

in following line

Dim user As user = _facebookAPI.Users.GetInfo()

 

problem-2) Here I am justable to get user's Full Name. How can I get his email address??