ASP.NET timeout cancelled.

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
 
A

Andrew Morton

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
 
G

Gab

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
 
G

Gab

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top