Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to handle Session

 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i suggest that the unload-action is also called by "refresh", before the refreshed site is loaded.
 
Ravi Kumar Ravuru
Ranch Hand
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi heiner weilandt,
Please can you elaborate on this and tell me what to do?
Ravi
 
heiner weilandt
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 176
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic