idle session

I

Iona

Hi,

usually session expires in 20 minutes, well mine is and I want to redirect the user to an error page telling them that their session has expired and they need to login again. How do I code that and where should I put it? Thanks.
 
K

Ken Schaefer

You can't do that using ASP, since ASP runs on the server, and once a page
is sent to the client, the server doesn't know anything about it anymore.

Instead, you can create a client-side refresh, eg using a javascript
timer -or- a meta refresh tag, that redirects the user after 20 minutes, eg:

<head>
<meta http-equiv="refresh" content="1200;URL=/loginpage.asp" />
</head.

Cheers
Ken


: Hi,
:
: usually session expires in 20 minutes, well mine is and I want to redirect
the user to an error page telling them that their session has expired and
they need to login again. How do I code that and where should I put it?
Thanks.
:
: -----------------------------
: This message is posted by http://Asp.ForumsZone.com
:
 
A

AHN

On some former page of your application start some session variable and at
the top of the page, in server side code, check if the value you had set is
still there. If the session is over, the variable will be empty, so your
server will know the sesion is over and redirect the client if so. Cheers.

Iona said:
Hi,

usually session expires in 20 minutes, well mine is and I want to redirect
the user to an error page telling them that their session has expired and
they need to login again. How do I code that and where should I put it?
Thanks.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top