473,378 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Postponing Session_End

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

Nov 19 '05 #1
4 860
st*********@hotmail.com wrote:
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
Nov 19 '05 #2
Good idea Hans, thanks - I'll try it.

Nov 19 '05 #3
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/

Nov 19 '05 #4
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.


"jasonkester" wrote:
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/

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Sibel | last post by:
Hey guys I have a user tracking setup to track users. What it does is once a user hits my site it sends me an email telling me some info and once a user clicks the logout button it sends a second...
9
by: Kenn Ghannon | last post by:
I've got an ASP.NET page with a counter subtraction routine in the Session_End method in the Global.asax.cs: protected void Session_End(Object sender, EventArgs e) { ulong curUsers; ...
2
by: Bela | last post by:
Hello I was wondering if someone could help me out with a Session_End problem in my Global.asax. I've tried everything, and still no success Here is the scenario: sessionstate is set to InProc....
3
by: Guadala Harry | last post by:
Just wondering if Session_End *always fires* for every Session. I know that IIS times out sessions after a default 20 min (unless changed) and there's no way to know when a user actually closed a...
4
by: Kim Bach Petersen | last post by:
I would like to record user behavior data stored in session variables. Since the data is modified throughout each session it seemed obvious to store the data when the session terminates - using...
7
by: Henry | last post by:
I have a question on session_end. I'm trying to log into my database when the session times out, it will store user info into a table. When I got step into a line where I was trying to open...
8
by: Roger | last post by:
When I call the session.abandon() method, it calls the session_end event. When a user closes the browser or clicks the log off button, I can dispose of objects and abandon the session cleaning....
1
by: =?Utf-8?B?YnJlbnQ5NjA=?= | last post by:
Environment: ASP.NET 2.0, SQL Server 2005, C#, Visual Studio 2005 In my Session_End event, I am executing a stored procedure to update a database table that is used to log user sessions. When...
12
by: =?Utf-8?B?QWxleCBNYWdoZW4=?= | last post by:
Hi. I am trying to maintain a list of people who are currently "online" in SQL. I do this by adding a simple entry to a simple PeopleOnline table whenever someone logs in to my site. If they...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.