Facebook is a popular social network portal, more and more applications are developed integrating facebook functions such as post on the wall, upload pictures to facebook.
Most time, the application is design for a single Facebook user, for my last project (a photo booth which allow user take photo and post the picture to Facebook) is a different case, and while developping, it was found that when a WebBrowser(C# Controll) used for facebook login, after closing the form which contains the WebBrowser and Dispose it, the Facebook login status is still there after the Form is repopened. Even the cookie file is clean, still cannot log off facebook. And there is no logoff function in Facebook SDK.
The solution I used is I make the login part to be a seperate Application, which will record the login Token after Facebook user login their facebook account, and send the login token to the main application when the facebook login application closed. While the application closing, the cookies are deleted.
This solution is worked in my project.