Postponing Session_End

S

stew_mclean

Hi,

I have a asp.net application, from which the user can click on links
which shell another app. The user then may remain in that app for a
while, before returning to the site.

The problem is that often their session may have ended when they come
back to the site. For reasons that will bore you, I cannot let this
happen (in a nutshell, the site and app are closely related, and ending
the session frees resources in the app which will kick the user out).

I would like to add code in session_end that will check if the user is
active in the other app, and if so, will not end the session (like,
reset the session timeout). I can easily determine that the user is in
the other app, I just have no idea how to postpone the session_end
whilst this is the case.

Any suggestions (please dont suggest just increasing the session
timeout - I have no idea how long the user may want to remain in the
other app).

Stew
 
H

Hans Kesting

Hi,

I have a asp.net application, from which the user can click on links
which shell another app. The user then may remain in that app for a
while, before returning to the site.

The problem is that often their session may have ended when they come
back to the site. For reasons that will bore you, I cannot let this
happen (in a nutshell, the site and app are closely related, and
ending the session frees resources in the app which will kick the
user out).

I would like to add code in session_end that will check if the user is
active in the other app, and if so, will not end the session (like,
reset the session timeout). I can easily determine that the user is in
the other app, I just have no idea how to postpone the session_end
whilst this is the case.

Any suggestions (please dont suggest just increasing the session
timeout - I have no idea how long the user may want to remain in the
other app).

Stew

Add a "refresh" to your page, with an interval (just) below the session timeout.
As long as the page is visible in the browser, the refresh occurs, so the
page is re-requested, so the session is refreshed.
When the browser is closed, or the user navigates away, the regular
session timeout works.

Hans Kesting
 
J

jasonkester

Well, first it sounds like you need to bump up the session timeout a
bit. Setting it to 16 hours would solve this problem completely.

Short of that, assuming your second app is hosted on the same network,
you could override session_end to look for evidence of the same user on
the other side. If your two apps share the same database, this could
be as simple as checking for a session record in the 2nd app with the
same UserID.

Anyway, it sounds like you're on the right track. Let us know how it
turns out.

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 
G

Guest

If the User open another app2 from link...set javascript variable to true
in app1...
and see if this variable is true refresh the app1 window or open a popup
giving warning/asking the user to kill that session or he wants to continue
with that one.....

If u have not set the javascript variable...and refresh page...for every 3
minutes...u basic session concept itself will go wrong if user not opens 2nd
applicaiton.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Session_End() 1
Session_End 4
Session_End 14
Session_End 3
Session_End 2
Testing if session_end fires 0
Global.asax: Session_End() Behavior 12
Session_Start/Session_End 3

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top