• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Expired after Browser closing

 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I would like to know that
how to expire the user's session when the browser(IE,FF,opera etc) gets closed(exited) directly i.e pressing Close(X) button on the top-right side.

How to determine that event?

We are able to expire session if user refreshes the page.But unable to find the solution for this case.


Thank you.
Regards
Baseet Ahmed

Knowledge is not what memorised.
Knowledge is what give benefits
(Imam Shafai)
 
Sudhakar Duraiswamy
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Can i know how is the what kind/on what basis the session validation is done in you application.


One can use session cookies to identify a particular session of the browser.
If the browser is closed ,the corresponding session cookies are destroyed
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no reliable way to do this.
It is better to allow the session to time out.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhakar,

We also came to know that using cookies we can check it.
But the case is, we are not using Cookies in our application.
Instead we are making the session id using Random class and some manual logic.

Any other alternative to find out the solution for mentoned problem.

Regards
Baseet Ahmed

Knowledge is not what memorised.
Knowledge is what give benefits.
(Imam Shafai)
 
Rishi Trehan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Baseet Ahmed wrote:All,
I would like to know that
how to expire the user's session when the browser(IE,FF,opera etc) gets closed(exited) directly i.e pressing Close(X) button on the top-right side.

How to determine that event?

We are able to expire session if user refreshes the page.But unable to find the solution for this case.


Thank you.
Regards
Baseet Ahmed

Knowledge is not what memorised.
Knowledge is what give benefits
(Imam Shafai)






Hi Imam Shafai

How to expire a session after refresh the window..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why on earth would you want to expire the session just because the user refreshed the window?
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Why on earth would you want to expire the session just because the user refreshed the window?

Bear,
I have seen some internet banking sites doing that. If you click on the refresh button/ back button of the browser a message is displayed saying that "because of security reasons back and refresh are disabled" and you will be automatically logged out of the site. I did not understand the reason for that though. Are back and refresh a threat to security in a secure web-app??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic