Sholo.Web.Security/Authentication/User/UserAuthentication.cs
/// <summary>
/// Sends a blank and expired FormsAuthentication cookie to the 
/// client response.  This effectively removes the FormsAuthentication
/// cookie and revokes the FormsAuthenticationTicket.  It also removes
/// the cookie from the current Request object, preventing subsequent 
/// code from being able to access it during the execution of the 
/// current request.  And just for good measure, it also replaces any
/// existing principal in the current request pipeline with an anonymous 
/// one.
/// </summary>
Sends a blank and expired FormsAuthentication cookie to the
client response.  This effectively removes the FormsAuthentication
cookie and revokes the FormsAuthenticationTicket.  It also removes
the cookie from the current Request object, preventing subsequent
code from being able to access it during the execution of the
current request.  And just for good measure, it also replaces any
existing principal in the current request pipeline with an anonymous
one.
Sends a blank and expired FormsAuthentication cookie to the client response . This effectively removes the FormsAuthentication cookie and revokes the FormsAuthenticationTicket . It also removes the cookie from the current Request object preventing subsequent code from being able to access it during the execution of the current request . And just for good measure it also replaces any existing principal in the current request pipeline with an anonymous one .
public static void ClearAuthCookie()
        {
            Initialize();
            HttpContext current = HttpContext.Current;
            current.Request.Cookies.Remove(FormsAuthentication.FormsCookieName);
            GenericPrincipal anon = new GenericPrincipal(new GenericIdentity(string.Empty), null);
            Thread.CurrentPrincipal = anon;
            current.User = anon;
            HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName)
            {
                Expires = DateTime.Now.AddMonths(-1),
                Domain = FormsAuthentication.CookieDomain,
                Path = FormsAuthentication.FormsCookiePath
            };
            current.Response.Cookies.Add(cookie);
        }
public static void ClearAuthCookie ( ) { Initialize ( ) ; HttpContext current = HttpContext . Current ; current . Request . Cookies . Remove ( FormsAuthentication . FormsCookieName ) ; GenericPrincipal anon = new GenericPrincipal ( new GenericIdentity ( string . Empty ) , null ) ; Thread . CurrentPrincipal = anon ; current . User = anon ; HttpCookie cookie = new HttpCookie ( FormsAuthentication . FormsCookieName ) { Expires = DateTime . Now . AddMonths ( - 1 ) , Domain = FormsAuthentication . CookieDomain , Path = FormsAuthentication . FormsCookiePath } ; current . Response . Cookies . Add ( cookie ) ; }
Sends a blank and expired FormsAuthentication cookie to the
client response.
Sends a blank and expired FormsAuthentication cookie to the client response .
// Don't let anything see the incoming cookie  // Remove the cookie from the response collection (by adding an expired/empty version).