ASP.NET timeout cancelled.

  • Thread starter Thread starter Gab
  • Start date Start date
G

Gab

Hello ,

I would like to know if it's possible to cancel the ASP.NET timeout ? I mean
my seesion in my APS.NET web page is not limited with a timeout after
login.

Thanks for your help.
Gab
 
Gab said:
I would like to know if it's possible to cancel the ASP.NET timeout ?
I mean my seesion in my APS.NET web page is not limited with a
timeout after login.

One simple way is to get the browser to refresh the page before the timeout,
so in the Page_Load sub you could have

Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) -
20))

(Session.Timeout is in minutes; the Refresh parameter is in seconds.)

Andrew
 
Thakns very much for your help !

Andrew Morton said:
One simple way is to get the browser to refresh the page before the
timeout, so in the Page_Load sub you could have

Response.AppendHeader("Refresh", Convert.ToString((Session.Timeout * 60) -
20))

(Session.Timeout is in minutes; the Refresh parameter is in seconds.)

Andrew
 
Thanks very much for your help !

Mark Rae said:
In addition to Andrew's post, you can change the Session.Timeout property
in web.config:
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.timeout.aspx

Note that the default property is 20 minutes (or sometimes 10 minutes
depending which MSDN page you happen to be reading!), and there are some
very good reasons for this, so you would be well advised to think
carefully before changing it:
http://stackoverflow.com/questions/412462/asp-net-session-timeout-why-20-minutes-used-as-default
http://msdn.microsoft.com/en-us/library/ms525473.aspx
 
Back
Top