Question

I have implemented a method by which a user can get a FB token on a windows phone 8 application. This is implemented via the Facebook C# SDK.

However, it seems that the client's token is cached, since the webbrowser control does not prompt for credentials anymore after the first logon.

Can anyone point out how to implement a logout method?

Was it helpful?

Solution

The Facebook credentials are stored in a cookie, so if the implementation of a logout method simply consists of clearing cookies.

If your app targets Windows Phone 8, there is a new simple API for doing that: ClearCookiesAsync.

Sample code:

await new WebBrowser().ClearCookiesAsync();

Here is a tutorial that makes use of it: http://www.developer.nokia.com/Community/Wiki/Integrate_Facebook_to_Your_Windows_Phone_Application

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top