Solved

Sending a 'Session Timed Out' message to a user

Posted on 2010-08-27
6
774 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
Comment Utility
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
Comment Utility
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
Comment Utility
Here is a session time custom control

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

Author Comment

by:tatton777
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now