title: Session ID does not change on logout
body: <p>I have searched almost everything on this but looks too confusing.I have a login control as below :</p>
  
  <pre><code>&lt;asp:Login ID="Login1" runat="server" Width="300px" onauthenticate="LoginControl_Authenticate" onloggedout="LoginStatus1_LoggedOut"&gt;
  </code></pre>
  
  <p>It logs in the user and uses cookies for authentication.I also added extra code to make sure that entire session gets destroyed on logout button as below ;</p>
  
  <pre><code>void LoginStatus1_LoggedOut(Object sender, System.EventArgs e)
  {
      HttpContext.Current.Session.Clear();
      HttpContext.Current.Session.Abandon();
      HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
      Response.Redirect("~/Login.aspx");
  }
  </code></pre>
  
  <p>The Session ID remains the same even after logout( for example, if i logout it does't direct me to the Login page as i want..so looks like it is not even executing the above event as i tried putting a breakpoint.When i log back in, it still carries the same Session ID.What am i doing wrong here
  ?
  Another thing is that I am displaying the Session ID as :</p>
  
  <pre><code> Session["SessionId"] = Session.SessionID;
  </code></pre>
  
  <p>and I am creating a new session like </p>
  
  <pre><code> HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
  </code></pre>
  
  <p>Are these two different sessions or the same?</p>
  
  <p>What are my options to clear all the session variables on logout.</p>
  
  <p><strong>Note</strong> : I also have this in Global.asax file but doesn't help</p>
  
  <pre><code> void Session_End(object sender, EventArgs e) 
  {
      HttpContext.Current.Session.Clear();
      HttpContext.Current.Session.Abandon();
      HttpContext.Current.Response.Cookies.Add(new HttpCookie("ASP.NET_SessionId", ""));
  }
  </code></pre>