• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 690
  • Last Modified:

How to detect inactivity and expire page automatically?

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
rpkhare
Asked:
rpkhare
  • 3
  • 2
1 Solution
 
M3mph15Commented:
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
 
rpkhareAuthor Commented:
Does the session has a timer by default?
0
 
M3mph15Commented:
Yes. I don;t know exactly what the timer is but the session does have a default timer value that can be overridden.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
rpkhareAuthor Commented:
I'll check and revert back.
0
 
ASPSQLServerCOMCommented:
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
 
rpkhareAuthor Commented:
Thanks
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now