Session Timeout Detection and Continue Session if Needed - Best Method ?

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hi,

I've searched many times for the best method to detect session time in an
ASP.NET 2.0/3.5 web application, however, the ones I've found did not have
option to continue session.

Could anyone point me to a code link that:
1. Detects session timeout.
2. Pop up a Yes/No dialog that allows user to continue session, then time
out completely if no response is made within a set time of minutes.

Thanks,
James
 
Mark,

Simply I want to avoid the exception errors that occur when session
variables become null after the timeout.

James
 
Mark Rae said:
[please don't top-post]
Simply I want to avoid the exception errors that occur when session
variables become null after the timeout.

if (Session["MyVariable"] != null)
{
// session variable exists, so use it
}
else
{
// session variable doesn't exist, so do something about it
}

Also, see:
http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=IsNewSession

Mark,

This is not what I am looking for. I can't go in and write code like that
all over the application within the context of first my post! This has to be
a global (application wide) solution.
Anyway, thanks for the links; that helped.

James
 
Back
Top