session auto expires after few minutes, how to keep it active?http://forums.asp.net/t/1794855.aspx/1?session+auto+expires+after+few+minutes+how+to+keep+it+active+Fri, 20 Apr 2012 07:47:26 -040017948554941690http://forums.asp.net/p/1794855/4941690.aspx/1?session+auto+expires+after+few+minutes+how+to+keep+it+active+session auto expires after few minutes, how to keep it active? this is my code on button login click:- if (rdr.Read()) { Session[&quot;User&quot;] = UserName.Text; Session[&quot;type&quot;] = rdr[0].ToString(); if (Session[&quot;type&quot;].ToString() == &quot;admin&quot;) { Response.Redirect(&quot;index.aspx&quot;); Literal1.Text = &quot;&lt;b&gt;Hello admin!&lt;/b&gt;&quot;; } else { Response.Redirect(&quot;index.aspx&quot;); Literal1.Text = &quot;&lt;bHello Student!&lt;/b&gt;&quot;; } } else { Literal1.Text = &quot;&lt;b&gt;Invalid credentials&lt;/b&gt;&quot;; } 2012-04-19T19:20:08-04:004941758http://forums.asp.net/p/1794855/4941758.aspx/1?Re+session+auto+expires+after+few+minutes+how+to+keep+it+active+Re: session auto expires after few minutes, how to keep it active? <p></p> <blockquote><span class="icon-blockquote"></span> <h4>ogsim07</h4> this is my code on button login click:- if (rdr.Read()) { Session[&quot;User&quot;] = UserName.Text; Session[&quot;type&quot;] = rdr[0].ToString(); if (Session[&quot;type&quot;].ToString() == &quot;admin&quot;) { Response.Redirect(&quot;index.aspx&quot;); Literal1.Text = &quot;&lt;b&gt;Hello admin!&lt;/b&gt;&quot;; } else { Response.Redirect(&quot;index.aspx&quot;); Literal1.Text = &quot;&lt;bHello Student!&lt;/b&gt;&quot;; } } else { Literal1.Text = &quot;&lt;b&gt;Invalid credentials&lt;/b&gt;&quot;; } </blockquote> <p></p> <p>check here:</p> <p><a href="http://www.codeproject.com/Articles/10550/The-Defibrillator-Keeping-ASP-NET-Session-Alive-Ad">http://www.codeproject.com/Articles/10550/The-Defibrillator-Keeping-ASP-NET-Session-Alive-Ad</a></p> 2012-04-19T20:09:33-04:004941851http://forums.asp.net/p/1794855/4941851.aspx/1?Re+session+auto+expires+after+few+minutes+how+to+keep+it+active+Re: session auto expires after few minutes, how to keep it active? <p>If your sessions are expiring too fast then you need to change the session expiry in your config file to a longer period of time.</p> <p>Also you will most likely want to make sure that sliding expiry is enabled in the config aswell (unless you only plan on letting users log in for a set amount of time).</p> 2012-04-19T22:37:49-04:004942357http://forums.asp.net/p/1794855/4942357.aspx/1?Re+session+auto+expires+after+few+minutes+how+to+keep+it+active+Re: session auto expires after few minutes, how to keep it active? <p>hi..</p> <p>You have to set session time out in web.confi file..By default the time will be set 20 minutes ..For your needs change the timeout..</p> <p>&lt;sessionState cookieless=&quot;UseCookies&quot; mode=&quot;InProc&quot; timeout=&quot;20&quot;&gt;<br> &lt;/sessionState&gt;</p> 2012-04-20T07:47:26-04:00