Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sending a 'Session Timed Out' message to a user

Posted on 2010-08-27
6
Medium Priority
?
873 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

963 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