Click here to Skip to main content
15,914,943 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi guys,

I have a situation here and I'm still cracking my head on how to solve it.

Here's the scenario:

1. User visits my website

2. User clicks on Login to FB (in order for my App to retrieve his FB info via the Api graph).

3. User logins with his FB credential and Approve the App.

4. User is redirected back to the same page that he clicks on the Login to FB button (in step 2, because the button, will invoke the method RedirectToFacebookAuthorization() ).

5. User then logs out from Facebook.com (my website hasn't implement any log out button for this scenario).

6. User has successfully logged out from his FB account, he revisit my website.

7. My website throws out an exception message as below:

Exception Details: Facebook.Utility.FacebookException: The session is invalid because the user logged out.
Posted

Exception says that you are trying to access something from the facebook(api) which needs the user to be logged in to the facebook but according to step #5-6 user has already logged out from there.

If you are getting this exception after step #6, then it is completely valid.

I may be wrong though, but this is what looks like the issue on the first place.
 
Share this answer
 
I suspect that your problem is because you have retained information about the session that you logged out from. I guess you are holding some sort of variable which has information about a facebook session. When you log out of that session and then start a new sesison by loging in again then you need to recreate the variable.
OR
may be you are missing any dll or an updated dll for facebook utility.
these links will be helpful:-

http://forum.developers.facebook.net/viewtopic.php?id=54994[^]

http://www.symbolsource.org/Public/Metadata/Default/Project/Facebook-Developer-Toolkit/Version-3.01/Release/All/Facebook/Facebook/Utility/FacebookException.cs[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900