•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,668 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,939 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 4264 | Replies: 4
![]() |
•
•
Join Date: Jan 2007
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 1
Hi,
I'm creating a membership style website and I have set the session timeout to 10 minutes (for now).
Ho do I redirect the user to a certain page (automatically) if the session has timeded out ?
For example... For some online banking if you login and leave the computer for e.g.. 5 mins. it automatically redirects you to a different page notifying you that you have been logged out.
Any Ideas?
Thanks.
ps. Session_OnEnd in the global.asa doesn't redirect.
I'm creating a membership style website and I have set the session timeout to 10 minutes (for now).
Ho do I redirect the user to a certain page (automatically) if the session has timeded out ?
For example... For some online banking if you login and leave the computer for e.g.. 5 mins. it automatically redirects you to a different page notifying you that you have been logged out.
Any Ideas?
Thanks.
ps. Session_OnEnd in the global.asa doesn't redirect.
•
•
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation:
Rep Power: 3
Solved Threads: 10
the easiest way is to put a response.redirect in the header of the page with the delay set to the same timeout (10 minutes in your case). Everytime the page loads after 10 minutes it will redirect the user to the page.
If the user submits something and refreshes the page it will start again as the page reloads (be careful if using ajax though!).
The other way is to use a timer to do the same thing.
The third and the best but also the more complex way is to use ajax and server callbacks.
If the user submits something and refreshes the page it will start again as the page reloads (be careful if using ajax though!).
The other way is to use a timer to do the same thing.
The third and the best but also the more complex way is to use ajax and server callbacks.
•
•
Join Date: Jan 2006
Location: Its the internet... i am everywhere lol
Posts: 274
Reputation:
Rep Power: 3
Solved Threads: 10
if you use a javascript timer and keep a reference to it in javascript you can run client side code on your controls to reset the timer if they make a keypress.
var timer = setTimeout(redirectfunction,600000);
redirectfunction
{
.....
}
function resetTimer()
{
clearTimer(timer);
setTimeout(redirectfunction,600000);
}
<html code>
....
<input type="text" onblur="resetTimer()">...etc.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
- Redirect to loginpage on Session timeout (C#)
- urgent: session timeout occurs unexpectedly(given both web.config & global.asax code) (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: Multi-language Web Application
- Next Thread: Information Tags


Linear Mode