locked
Clear cookies in Windows Authencation broker

    General discussion

  • Hi,

    I wanted to check if its possible to clear cookies manually from WAB. If an app creates cookies and doesn't have a way to clear cookies, is there a way the cookies can be cleared manually? Or is to possible to reset everything.

    It wanted to check about this for both Windows Store and Windows Phone.

    Thanks,

    Anuj


    The opinions expressed here are completely my own. I also blog on http://www.anujchaudhary.com/

    Thursday, June 19, 2014 9:34 PM

All replies

  • Try following code to see if the cookie can be cleaned:

    Windows.Web.Http.Filters.HttpBaseProtocolFilter myFilter = new Windows.Web.Http.Filters.HttpBaseProtocolFilter(); 
    var cookieManager = myFilter.CookieManager; 
    HttpCookieCollection myCookieJar = cookieManager.GetCookies(new Uri("your WAB url")); 
    foreach (HttpCookie cookie in myCookieJar) 
    { 
        cookieManager.DeleteCookie(cookie); 
    }

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, June 20, 2014 12:32 AM
    Moderator
  • Thanks. I was thinking of something manual which an end user can do. Clearing cookies or resetting WAB. Anything which can bring the user back to a clean state.

    Thanks,

    Anuj


    The opinions expressed here are completely my own. I also blog on http://www.anujchaudhary.com/

    Friday, June 20, 2014 1:53 AM
  • Remove the folder? A user can also manually clean app's cookie, you can ref to matt's blog: http://blogs.msdn.com/b/wsdevsol/archive/2012/10/18/nine-things-you-need-to-know-about-webview.aspx#AN7

    Delete the INetCookie or INetCache could be what you need.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, June 20, 2014 1:56 AM
    Moderator
  • Thanks. I found the folders INetCache, INetCookies and INetHistory under %localappdata%\packagename\AC but they were empty. Deleting those folders didn't change anything.

    However, on more searching online, I found the command "regsvr32 /i:p /s AuthBroker.dll" which cleans up everything for WindowsStore platform.

    Are any side effect of doing this?

    Also, how can I run this or similar command on WindowsPhone platform?

    Thanks,

    Anuj


    The opinions expressed here are completely my own. I also blog on http://www.anujchaudhary.com/

    Friday, June 20, 2014 9:17 PM