locked
after using httpcookie, can not logout problem? RRS feed

  • Question

  • User1361142914 posted

    I have included following line in web.config file:

    <httpCookies domain=".YourMainDomain.com"/> 

    But, after that, I could not logout. Following is the logout event:

     protected void LoginStatus1_OnLoggedOut(object sender, EventArgs e)
    
        {
    
            Response.Cookies.Remove(FormsAuthentication.FormsCookieName);
    
            FormsAuthentication.SignOut();
    
            Roles.DeleteCookie();
    
            Session.Clear();
    
        }

     

     

     

    Friday, February 18, 2011 5:24 PM

Answers

  • User533502567 posted

    Response.Cookies.Remove(FormsAuthentication.FormsCookieName); FormsAuthentication.SignOut();

    Code looks good to me. But probably you may want to add this code to Logout button click event.

    LoginStatus.OnLoggedOut Method Raises the LoggedOut event after the user clicks the logout link and logout processing is complete. 

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 21, 2011 11:47 AM