Detect when the session is going to time out and display some kind of message.

U

UJ

How do you detect when your session is going to timeout and display a
message saying 'unless you do something you will be logged out' much the way
bank web pages do?

Can you do it for the site or do you need to put code on every page doing
it?

TIA
 
C

Curt_C [MVP]

UJ said:
How do you detect when your session is going to timeout and display a
message saying 'unless you do something you will be logged out' much the way
bank web pages do?

Can you do it for the site or do you need to put code on every page doing
it?

TIA

Nope...you could toss a timer on the page and do it yourself, but you
can't poll the session timer, without restarting it...
 
L

Lucas Tam

How do you detect when your session is going to timeout and display a
message saying 'unless you do something you will be logged out' much
the way bank web pages do?

You could put a javascript timer on the page to detect idleness.

Or if you're using SQL server as your state server, you could poll a web
service using client javascript to get a more accurate time. Just make sure
the web service is running under a different app than your ASP.NET
application, otherwise the session timer will get reset on each request.
 

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,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top