Session timeout

E

EricW

Hi,

Is there a way to have a ASPX page check if a session ends

I ask this because on my page there is a part where you have to log in.
After being logged in, you can enter a menu and do some stuff.
While someone is logged in, the login is blocked to prevent changes by
different users at the same time.
I set the session.timeout to 20 minutes.

I would like to know how the page can cleanup after it and end it's session
either by timeout or by going to another page or by closing the browser.

rg,
Eric

btw: Happy New Year!!!
 
M

Mark Rae

While someone is logged in, the login is blocked to prevent changes by
different users at the same time.

??? So only one user can be logged in at any one time...???

Surely not...
 
L

Laurent Bugnion [ASP.NET MVP]

Hi,
Hi,

Is there a way to have a ASPX page check if a session ends

I ask this because on my page there is a part where you have to log in.
After being logged in, you can enter a menu and do some stuff.
While someone is logged in, the login is blocked to prevent changes by
different users at the same time.
I set the session.timeout to 20 minutes.

I would like to know how the page can cleanup after it and end it's session
either by timeout or by going to another page or by closing the browser.

rg,
Eric

btw: Happy New Year!!!

When the timeout fires (which is approximately 20 minutes (according to
your settings) after the last active content has been rendered by the
server (by active content, I mean ASPX, ASMX, ASHX, etc...)), the method
Session_End is called. This method is not present by default in ASP.NET
2.0. To have it and to implement cleanup actions, you add the Global
Application Class to your web project. Then, add the following method:

protected void Session_End( object sender, EventArgs e )
{
// Your cleanup code here
}

The method will be called by the server each time that a session ends,
be it by user action (using the Session.Abandon method), or by a timeout.

HTH,
Laurent
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top