Please note you need to delete Facebook’s Cookies i.e. not ServiceStack’s which are already taken care of. The easiest way to do this is to visit facebook.com and delete the cookies in WebInspector or just logout of Facebook from the menu item.
That makes sense. But of course we can’t delete cookies from other sites programatically. So since we’re not using the JS client there is no way to log out the user from Facebook oauth.
Hmm, which if that is true we’re not being very secure.
I sit down at a shared computer, login with oauth, then logout (which does nothing to oauth), then the next person comes along, clicks login and away they go on the other account.
I discovered that my UserSessions are somehow being shared between all instances! (I open a different browser and I’m still logged in) Crazy pills! I feel like I cloned the SocialBootstrapapi project pretty closely, and I don’t have any static variables.
Then I looked more closely at AppHost.cs and discovered I was registering a SINGLETON of CustomUserSession?! What was I thinking?!
The error of my ways:
var customSession = new CustomUserSession
{
AppSettings = AppSettings,
repositoryFactory = container.Resolve<IRepositoryFactory>()
}
Plugins.Add(new AuthFeature(
() => customSession,