facebook-csharp-sdk / facebook-winclient-sdk

Facebook SDK for Windows & Windows Phone
http://facebooksdk.net
Apache License 2.0
61 stars 139 forks source link

Logout doesn't work #71

Open silvio-terzi opened 9 years ago

silvio-terzi commented 9 years ago

The logout method doesn't really disconnect the user from Facebook. After logout, when I try to login again immediately, it doesn't open the login mask; instead open a page that said that you've just authorized the app (sometimes, or doesn't open a page at all), for the user just disconnected. If I want to change the user, I can't. To login I've used the WebView only option.

brainoffline commented 9 years ago

This is a solution for WinRT

            // Clear out any facebook cookies
            var myFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter();
            var cookieManager = myFilter.CookieManager;
            var myCookieJar = cookieManager.GetCookies(new Uri("https://facebook.com"));
            foreach (var cookie in myCookieJar)
                cookieManager.DeleteCookie(cookie);