Solved

How to detect inactivity and expire page automatically?

Posted on 2008-10-21
6
681 Views
Last Modified: 2010-04-21
In one of my web-page I require that if user is not working on it and it remains neglected for certain interval, it should automatically return to the home page.
0
Comment
Question by:rpkhare
[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
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:M3mph15
ID: 22773583
When they log in add a variable to the session and check for it in the page_load. The session has a timer. So say its 30mins then the session will expire after 30mins of inactivity. So when it doesn't find the session either they havent logged in or the session is expired. So something like this:
Protected Sub Page_Load()
      Dim s as string = Session("[variable]")
      if s Is Nothing Then
               Response.Redirect("Home.aspx")
      End If
End Sub
0
 
LVL 8

Author Comment

by:rpkhare
ID: 22789153
Does the session has a timer by default?
0
 
LVL 6

Expert Comment

by:M3mph15
ID: 22792857
Yes. I don;t know exactly what the timer is but the session does have a default timer value that can be overridden.
0
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
LVL 8

Author Comment

by:rpkhare
ID: 22793680
I'll check and revert back.
0
 
LVL 7

Accepted Solution

by:
ASPSQLServerCOM earned 125 total points
ID: 22796459
HI, if you are looking at the client side only (means page already loaded in browser) and after certain time you can redirect the page to some default page

http://javascript.internet.com/page-details/session-time-out.html

0
 
LVL 8

Author Closing Comment

by:rpkhare
ID: 31508439
Thanks
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

Suggested Solutions

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

710 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