Solved

How to detect inactivity and expire page automatically?

Posted on 2008-10-21
6
673 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

13 Experts available now in Live!

Get 1:1 Help Now