likewer
likewer

Reputation: 216

How to clear cookie in windows phone 8

I successful done the authentication login part by using POST method.

I want to clear the cookie that i obtain in authentication post method when i clicked the logout button.

Any approach to destroy or clear the cookie?

I have search the resources in google but can't find any solution

I also have do the research in MSDN about the method of cookiecontainer but it don have any method of clear and set expired in windows phone.

Clear Cookie

Delete cookie

CookieContainer Class

Upvotes: 0

Views: 4861

Answers (1)

Olivier Payen
Olivier Payen

Reputation: 15268

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

No matter which instance of WebBrowser it's called on. 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

Upvotes: 3

Related Questions