Solved

How to detect inactivity and expire page automatically?

Posted on 2008-10-21
6
678 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
  • 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
Independent Software Vendors: 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!

 
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

Technology Partners: 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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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