aspose file tools*
The moose likes Servlets and the fly likes How to handle Session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to handle Session" Watch "How to handle Session" New topic
Author

How to handle Session

Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176
Hello All,
I had developed an application with Frames, maintaining the sessions for different users.If the user closes the browser without clicking logout,iam calling logout page on unload event on frame.The problem is when the user refresh the frames page,the unload event is called and logout screen is displayed which is not to be happened.How to overcome this problem?Pls suggest me.
Thanks in Advance.
Ravi
heiner weilandt
Ranch Hand

Joined: Sep 10, 2002
Posts: 46
hi,
i suggest that the unload-action is also called by "refresh", before the refreshed site is loaded.
Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176
Hi heiner weilandt,
Please can you elaborate on this and tell me what to do?
Ravi
heiner weilandt
Ranch Hand

Joined: Sep 10, 2002
Posts: 46
sorry, i don't know.
but why you don't try it with an timeout of your session ?
then you can forget the unload-event. when the timeout (user don't make any request till five minute or something else....) is fired, you can delete your session.
ciao
heiner :roll:
Ravi Kumar Ravuru
Ranch Hand

Joined: Apr 18, 2002
Posts: 176
Hi heiner weilandt,
Thanks for ur reply.
As session times out,iam removing the session.But i want to invalidate the session when the user closes the window insteading of clicking logout button.
Ravi
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
Ravi
There is no easy way to let the server know that the client has closed their browser. The client doesn't make any kind of call to the server to do this, it just does it. You might try something with a small unseen applet that lets the server know that the applet has been stopped - that's about the only thing I can think of and its not a sure thing either.
Did you try to do a search for this? It's been asked quite a few times before.


Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to handle Session