aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Session handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Session handling" Watch "Session handling" New topic
Author

Session handling

Raj Joe
Ranch Hand

Joined: Oct 15, 2004
Posts: 41
How do i clear the http session data when the user closes the browser.
Can i invalidate a user session when the user closes the browser.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
You might be able to use JavaScript to send some request back to the server upon closing the browser window. I don't know for sure.

I do know that this is not a Java in General (beginners) type question.

If you're looking for a better understanding of how sessions are handled in Java-based web applications, I recommend moseying on over to the Servlets forum.

I'm moving this thread to the HTML and JavaScript forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

Raj,
You can't do this in Netscape at all. There is no way to detect the browser close. The best you can do is let the session timeout.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
jQuery in Action, 2nd edition
 
subject: Session handling