• 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

Invalidating the session in all browsers on closing the window

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to invalidate the session on closing the browser screen. I tried using onBeforeonLoad Method of form and event's in jsp but it is not working for all the browsers.

I want to do that in Morzila,Opera and IE through jsp's Can any one help in this regard

Thanks in Advance

Pooja
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pooja Chetty:
onBeforeonLoad Method of form and event's in jsp but it is not working for all the browsers.



onBeforeonLoad is this the method name??

as you say its not working.. behalf on it are you getting any error. please check javascript Console inside the tool menu of Firefox after run jsp. if it is then paste it here, it could be more easier to figure out the problem.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pooja Chetty:
I want to invalidate the session on closing the browser screen.



just come in mind..

use Unload event inside body or in form element.
 
Pooja Chetty
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saifu,
Thanks for the reply. But yet i am not able to do because i am getting the following error in the java console on use of windoe.event/window.Event

Error: event is not defined
Source File: http://localhost:8080/SBIGLSUS/js/loginTrouble.js
Line: 56
 
Muhammad Saifuddin
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now your query is no more related with JSP becuase right now you getting an error inside your javascirpt file..

Suggestion :
It better to move you question in HTML/JAVASCRIPT forum to get the better response on your query.
 
Sheriff
Posts: 67747
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
For the 17th bazillion time, you cannot reliably do this. Be sure that your web app can deal with orphaned sessions.
 
Pooja Chetty
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry i didnt understand what you are trying to say. Is there no way to invalidate the session in Mozilla or Opera through JS once browser is closed?
 
Bear Bibeault
Sheriff
Posts: 67747
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
That is correct. There is no way to be reliably informed that the browser has closed. Your app must be able to deal with this situation.
 
A lot of people cry when they cut onions. The trick is not to form an emotional bond. This tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic