Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session timeout problem! Need an intuitive solution!

Status
Not open for further replies.

bsingin64

IS-IT--Management
Oct 24, 2001
63
US
I have a 2 page website. The first page is a logon page. The second is an activeX control showing a custom app. I need to track web users through session/application scope variables. I require, that while the user is on the activex page...that their session not expire. Problem is, A session expires at timeout if no page loads have occurred, or if no variables have been saved in the session scope.

Is there a way to constantly "ping" the session to keep it active? (without loading or refreshing a page). i only want the session to timeout after the user closes their browser or loggs off

Idea 1: Slowly loop constantly. On each itteration, update a session variable (alive=alive+1). I need such a function to run on page load in the background, constantly, through vbscript or javascript. When user closes his browser, the loop stops(of course) and session times out after one minute.

Note: i can't refresh the current page, I dont want to open a child window that refreshes, I need a solution fast!!!

Please help! Brandon W
 
If you ONLY want the Session to timeout when a user logs off or closes their browser then you can just set the Session Timeout value to a large value - maybe do this in your global.asa file.
Code:
Sub Session On_Start
  Session.TimeOut = 10000
End Sub

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
sessions dont time out when a browser window is closed though..unless i call a Body unload event to abandon the session Brandon W
 
I cannot with an intriguing solution . I loaded a second frame with a zero Percent width. In that frame I loaded a page that had a meta refresh tag to refresh it every 30 seconds. This in turn kept my session alive. ALso with this implementation. The page that i use to refresh, also does session /application management. To enlighten you, it checks for the existance of a certain key in an array held in the application scope. If a person loggs on with the same name, then that key is deleted. And within 30 seconds (refreshdelay). The existing logged on client is kicked off their session and droped on the login page saying "you have logged in at a different location".

Hey, i know its not microsoft quality code, but down and dirty gets me where i need to be.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top