473,386 Members | 1,820 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,386 software developers and data experts.

how do i detect when a session ends?

Hi,

I would like to be able to detect when a session ends in a page_load event
in asp.net - is this possible?
Thanks.
Nov 19 '05 #1
6 1307
You can't.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Blair" <jo********@hotmail.com> wrote in message
news:Cl************@newsfe3-gui.ntli.net...
Hi,

I would like to be able to detect when a session ends in a page_load event in asp.net -
is this possible?
Thanks.

Nov 19 '05 #2
Thanks but you can.

either test session("var") is nothing or use
Session.IsNewSession

Thanks.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...
You can't.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Blair" <jo********@hotmail.com> wrote in message
news:Cl************@newsfe3-gui.ntli.net...
Hi,

I would like to be able to detect when a session ends in a page_load
event in asp.net - is this possible?
Thanks.


Nov 19 '05 #3
Wrong.

That only detects whether a session is a new session,
not whether an old session has timed out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Blair" <jo********@hotmail.com> wrote in message
news:ei***********@newsfe1-win.ntli.net...
Thanks but you can.

either test session("var") is nothing or use
Session.IsNewSession

Thanks.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...
You can't.
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"John Blair" <jo********@hotmail.com> wrote in message
news:Cl************@newsfe3-gui.ntli.net...
Hi,

I would like to be able to detect when a session ends in a page_load event in
asp.net - is this possible?
Thanks.



Nov 19 '05 #4
Off topic but I couldn't contact you otherwise Juan. Do you know more about
this issue now ? :

http://groups.google.com/group/micro...e739422c37633f

Cheers,
Tom Pester
Wrong.

That only detects whether a session is a new session, not whether an
old session has timed out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"John Blair" <jo********@hotmail.com> wrote in message
news:ei***********@newsfe1-win.ntli.net...
Thanks but you can.

either test session("var") is nothing or use
Session.IsNewSession
Thanks.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...
You can't.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"John Blair" <jo********@hotmail.com> wrote in message
news:Cl************@newsfe3-gui.ntli.net...

Hi,

I would like to be able to detect when a session ends in a
page_load event in
asp.net - is this possible?
Thanks

Nov 19 '05 #5
I still owe you, Tom.

This is a pesky issue.
We've had a couple of exchanges, but nothing definitive yet.

As soon as we have something definite, I'll post it.

Thanks.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

"tom pester" <To********************@pandora.be> wrote in message
news:a1***************************@news.microsoft. com...
Off topic but I couldn't contact you otherwise Juan. Do you know more about this issue
now ? :

http://groups.google.com/group/micro...e739422c37633f

Cheers,
Tom Pester
Wrong.

That only detects whether a session is a new session, not whether an
old session has timed out.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"John Blair" <jo********@hotmail.com> wrote in message
news:ei***********@newsfe1-win.ntli.net...
Thanks but you can.

either test session("var") is nothing or use
Session.IsNewSession
Thanks.

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Oa**************@TK2MSFTNGP12.phx.gbl...

You can't.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
"John Blair" <jo********@hotmail.com> wrote in message
news:Cl************@newsfe3-gui.ntli.net...

> Hi,
>
> I would like to be able to detect when a session ends in a
> page_load event in
> asp.net - is this possible?
> Thanks.


Nov 19 '05 #6
I'll second that.

On the server side, whenever you process a request, there is a session
associated (if it is a new one, IsNewSession is true).

Even if you call Session.Abandon() in your page_load, in your
page_prerender, the session is still valid for _this_ request (not for
the next one -> will be within a new session).

Hence the only way to determine that some call has abandoned the
session within a request is to set some flag in session or request
state (e.g. Session["AboutToEnd"]=true) and then check for this flag
when rendering your output (.Visible=(Session["AboutToEnd"]==null))

Remember, this is server side - clientside is a whole different story
where you can tackle the session timeout beast e.g. with javascript

Nov 19 '05 #7

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

Similar topics

4
by: sm mehta | last post by:
Hi, I have a web Application that must be licensed. When Customer buys 2 licensees for my application they can only have 2 copies open at a time. What I am doing right now is, I am storing No....
12
by: ACaunter | last post by:
Hi all, I was wondering how i could write some code which would automatically open the Login Page once the session has expired? -- AdamPC@hotmail.com
4
by: Harri Pesonen | last post by:
I have an ASP.NET application that runs threads in background. Application does not close if the web site is stopped. So how can the application get an event when the site has been stopped, so that...
2
by: Cam | last post by:
Hi to all I have searched this subject and found some posts but none of them seem to answer my problem. I am developing a shop site and need to detect when a session times out through...
4
by: Dst | last post by:
This is what i'm trying to do: I'm porting a windows app to a web app. I have a webform which will edit some data stored in a database. The data needs to be locked in the database, while editing....
18
by: sebastian | last post by:
Can this be done without client-side scripting? I thought sessions might be the answer but after some testing found that sometimes the old session data remained even after the user left the site...
9
by: tomhawkins1 | last post by:
Hi I currently have a site where users can upload files. These files can be doc, wmv, jpeg, xls, dwf, dwf and dwg. These files are uploaded to /home/**user**/uploads and not /home/...
0
by: =?Utf-8?B?am1hZ2FyYW0=?= | last post by:
My program needs to do X when someone 'starts using' their Windows user account, and it should do Y when they 'stop using' their Windows user account. By 'starts using' I mean they log on, unlock...
4
by: goscottie | last post by:
I used submodal as my popup window. With some tweaks, it working great in my app. However, I can't find a way to detect session timeout in the popup window. The app is a form based...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.