title: Asp.net membership logout doesn't work
body: <p>I am trying to implement membership in my application but i have a problem.
  This is my login code i am creating the ticket on login:</p>
  
  <pre><code>Kullanici kullanici = KullaniciProvider.KulaniciGetirEmailSifreIle(LoginControl.UserName, LoginControl.Password);
  if (kullanici != null)
  {
      Session["Kullanici"] = kullanici;
      string rol = "Firma";
      if (kullanici.KullaniciTipi == "Admin")
          rol = "Admin";
  
  
      FormsAuthentication.SetAuthCookie(LoginControl.UserName, true);
      FormsAuthenticationTicket ticket = new
      FormsAuthenticationTicket(
           1,
           LoginControl.UserName,
           System.DateTime.Now,
           System.DateTime.Now.AddMinutes(20),
           true,
           rol,
           FormsAuthentication.FormsCookiePath);
      string encTicket = FormsAuthentication.Encrypt(ticket);
      Response.Cookies.Add(new
      HttpCookie(FormsAuthentication.FormsCookieName, encTicket));
      Response.Redirect(FormsAuthentication.GetRedirectUrl(LoginControl.UserName, true));
  }
  </code></pre>
  
  <p>This is my Global.asax file getting the roles:</p>
  
  <pre><code>if (HttpContext.Current.User != null)
  {
      if (HttpContext.Current.User.Identity.IsAuthenticated)
      {
          if (HttpContext.Current.User.Identity is FormsIdentity)
          {
              FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity;
              FormsAuthenticationTicket ticket = (id.Ticket);
              if (!FormsAuthentication.CookiesSupported)
              {
                  //If cookie is not supported for forms authentication, then the
                  //authentication ticket is stored in the URL, which is encrypted.
                  //So, decrypt it
                  ticket = FormsAuthentication.Decrypt(id.Ticket.Name);
              }
              // Get the stored user-data, in this case, user roles
              if (!string.IsNullOrEmpty(ticket.UserData))
              {
                  string userData = ticket.UserData;
                  string[] roles = userData.Split(',');
                  //Roles were put in the UserData property in the authentication ticket
                  //while creating it
                  HttpContext.Current.User =
                    new System.Security.Principal.GenericPrincipal(id, roles);
              }
          }
      }
  }
  </code></pre>
  
  <p>and this is my Site.Master.When user logging out the code is not working. The user can not sign out properly</p>
  
  <pre><code>protected void LoginStatusGiris_LoggingOut(object sender, LoginCancelEventArgs e)
  {
  
      Session.Clear();
      Session.Abandon();
      Session.RemoveAll();
      deleteCookies();
      FormsAuthentication.SignOut();
      FormsAuthentication.RedirectToLoginPage();
  
  
  }
  private void deleteCookies()
  {
      string[] cookies = Request.Cookies.AllKeys;
      foreach (string cookie in cookies)
      {
          Response.Cookies[cookie].Expires = DateTime.Now.AddDays(-1);
      }
  }
  </code></pre>
  
  <p>I have deleted all the cookies but couldn't find a solution.</p>