Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

valueUnbound problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm trying to figure out how to close a user session when he or she closes the web browser.
The ValueUnbound event is invoked only when session timeout expires.
any ideas??
http://www.wirescale.com/
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oddly enough I just had to deal with this problem myself today. Check out this thread in the HTML/JavaScript forum.
From my code in that thread you can see how to fire off a JavaScript function when the browser is closed or a user navigates off of your site. That JavaScript function opens a new window and points to a servlet/JSP/Struts Action/whatever that does any cleanup you need done and invalidates the session. I use Struts, so I have my struts Action forward to a page that simply closes itself, thus getting rid of the popup you just opened. You can do this by placing on1oad="self.close()" (replace the number 1 with L there, UBB can be a pain sometimes) in your <body> tag.
HTH
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic