title: Changing expiry on ASP.NET's Session State cookie
body: <p>I'm using ASP.NET Session State to keep track of logged in users on my site.</p>
  
  <p>However, one problem I'm running into is that by default ASP.NET session cookies are set to expire when the browser closes.</p>
  
  <p><a href="http://ahb.me/43e">http://ahb.me/43e</a></p>
  
  <p>I've tried setting my own ASP.NET_SessionId cookie and modifying the cookie's expiry using something similar to the following code:</p>
  
  <pre><code>Response.Cookies["ASP.NET_SessionId"].Expires = DateTime.Now.AddMonths(1);
  </code></pre>
  
  <p>None of these approaches work, they all set a second cookie with the same name.</p>
  
  <p>Is there a way of changing the session cookie's expiry?</p>