• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Expired after Browser closing

 
Ranch Hand
Posts: 225
Spring Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Crusading Chameleon likes the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic