• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Session Expired after Browser closing

 
Ranch Hand
Posts: 225
Spring Notepad Java
  • 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)
 
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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • 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
Spring Notepad Java
  • 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)
 
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..
 
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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?
 
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??
 
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!