Solved

Sending a 'Session Timed Out' message to a user

Posted on 2010-08-27
6
821 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
6 Comments
 
LVL 18

Expert Comment

by:Anil Golamari
ID: 33543920
0
 
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 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 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