Session.Abandon when closing the browser

J

JMM B

How can I execute asp.net SESSION.ABANDON from a client script event
onbeforeunload.
I'm trying to do this to logout a user without waiting for the session
timeout.
thanks a lot.
 
K

Kevin Spencer

By sending a Request to the server.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 
B

bruce barker

as onbeforeunload fires on every page refresh or postback, you could just
call SessionAbandon at the end of processing of every aspx page and get the
same effect. might be easier to just turn sessions off though.

-- bruce (sqlwork.com)
 
J

JMM B

Sorry, I think I wasn't very accurate in my question. That's what I
want.
I am trying to immediatly end a session when the browser is closed (in
the event a user does not log out). And not wait for session timeout.
thanks,
 
J

JMM B

When you close the browser, the session is kept in the web server for 20
minutes by default.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top