Page expiration - Is it with Session.Timeout

  • Thread starter naijacoder naijacoder
  • Start date
N

naijacoder naijacoder

what i need i think its a session timeouts.
Which i'm using like:-
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
I want my page to be active for like 20mins and after that redirected to
a page to inform the users that the session is over .
Another thing i did was to input Session.Timeout = 2 in my pageload
directly but i want to redirect to another page after the session ends.
How to do this?




Thanks
 
R

Rick Strahl [MVP]

You'll need some javascript with a timer object on the page to do this. A
session tiemout will not affect an existing page. Start the timer when the
page starts, then fire an event that navigates off to another page that
displays your error message or whatever you need.

Also make sure that you set page expiration with the Response.Expires
header, so that the page will timeout at the HTTP Cache level and the user
can't click BACK to get back to the page that way.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
http://www.west-wind.com/wwThreads/
 
K

Konrad Rotuski

lets assume you have something stored under "Object" key in Session object
(Session("Object") = sth)

so what you need to determine whether session is timed out is :

if IsNothing(Session("Object")) Then Response.Redirect(url)

HTH

Konrad
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top