Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 686
  • 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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