?
Solved

Sending a 'Session Timed Out' message to a user

Posted on 2010-08-27
6
Medium Priority
?
866 Views
Last Modified: 2012-06-27
Hello,

I want to let my users know if their session has timed out. Can anyone tell me how to detect a timeout and how to redirect to a 'session_has_time_out.aspx' page that I've created.

Thanks.
0
Comment
Question by:tatton777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 33543946
Here's the way I'm detecting timeout (pulled from an article @ 4guysfromrolla.com):

The AddHeader() call is adding a meta-refresh to the page sent back to the client, instructing the client browser to automatically refresh the page 3 seconde (in this example) after the session's timeout value. Note that I'm multiplying by 60 since the Timeout is in minutes and the meta values needs to be in seconds.
// Send header to refresh page 3 seconds after session times out
//   This should redirect the user to the timeout page
page.Response.AddHeader("Refresh", (page.Session.Timeout * 60 + 3).ToString());

if (page.Session["sessionobj"] == null)
{
    page.Server.Transfer(PageNames.PAGE_SESSION_EXP);
}

Open in new window

0
 
LVL 16

Accepted Solution

by:
SriVaddadi earned 2000 total points
ID: 33545233
Here is a session time custom control

http://www.eggheadcafe.com/articles/20051228.asp
0
 
LVL 1

Author Comment

by:tatton777
ID: 33719950
Please leave the thread open a little longer as I now have enough time on my hands to try some of the suggestions that were given in this thread. With a little more time I can try the suggestions and then hopefully give someone some points.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question