By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,857 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,857 IT Pros & Developers. It's quick & easy.

Session_end, User Identity and resource cleanup

P: n/a
Hi,

I am looking to clean up some database locks whenever a user session ends. A
user session ends whenever they:

a. shut down the browser and the session times out after 20 mins (20 mins is
the default)
b. they click logout button and I call session.abandon()

However a user session ID can be the same over multiple sessions if it is in
the same browser instance apparently.

How can I get user identity information in the session_end routine - as the
HttpContext object is not available there. Neither is the Response object.

Or alternatively - is there some serverside event that occurs when a user
authentication expires or is logged out by a formsauthentication.signout --
I guess I could free the resources there...

Thanks,
Dan.
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi, Dan,

In the Session_End event handler you can still read from the Session
collection - just store the ID of the user inside it when the user signs in.

Hope this helps
Martin
"Dan Walls" <wa****@hotmail.com> wrote in message
news:40********@dnews.tpgi.com.au...
Hi,

I am looking to clean up some database locks whenever a user session ends. A user session ends whenever they:

a. shut down the browser and the session times out after 20 mins (20 mins is the default)
b. they click logout button and I call session.abandon()

However a user session ID can be the same over multiple sessions if it is in the same browser instance apparently.

How can I get user identity information in the session_end routine - as the HttpContext object is not available there. Neither is the Response object.

Or alternatively - is there some serverside event that occurs when a user
authentication expires or is logged out by a formsauthentication.signout -- I guess I could free the resources there...

Thanks,
Dan.

Nov 18 '05 #2

P: n/a
> b. they click logout button and I call session.abandon()
You need to be extremely careful here. See this article:
http://www.developersdex.com/gurus/articles/746.asp

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Dan Walls" <wa****@hotmail.com> wrote in message
news:40********@dnews.tpgi.com.au...
Hi,

I am looking to clean up some database locks whenever a user session ends.
A
user session ends whenever they:

a. shut down the browser and the session times out after 20 mins (20 mins
is
the default)
b. they click logout button and I call session.abandon()

However a user session ID can be the same over multiple sessions if it is
in
the same browser instance apparently.

How can I get user identity information in the session_end routine - as
the
HttpContext object is not available there. Neither is the Response object.

Or alternatively - is there some serverside event that occurs when a user
authentication expires or is logged out by a
formsauthentication.signout --
I guess I could free the resources there...

Thanks,
Dan.

Nov 18 '05 #3

P: n/a
> In the Session_End event handler you can still read from the Session
collection - just store the ID of the user inside it when the user signs
in.
No, this isn't guaranteed to work. Abandon is responsible for tearing down
the session object before the session end event fires. You aren't guaranteed
valid results using this approach.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Martin Dechev" <de*******@hotmail.com> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl... Hi, Dan,

In the Session_End event handler you can still read from the Session
collection - just store the ID of the user inside it when the user signs
in.

Hope this helps
Martin
"Dan Walls" <wa****@hotmail.com> wrote in message
news:40********@dnews.tpgi.com.au...
Hi,

I am looking to clean up some database locks whenever a user session
ends.

A
user session ends whenever they:

a. shut down the browser and the session times out after 20 mins (20 mins

is
the default)
b. they click logout button and I call session.abandon()

However a user session ID can be the same over multiple sessions if it is

in
the same browser instance apparently.

How can I get user identity information in the session_end routine - as

the
HttpContext object is not available there. Neither is the Response
object.

Or alternatively - is there some serverside event that occurs when a user
authentication expires or is logged out by a

formsauthentication.signout --
I guess I could free the resources there...

Thanks,
Dan.


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.