• 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 on closure of browser

 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi


I have to introduce licensing framewrok to my webapplication ..which mean to say that i will give the clinet saying that u can run only 20 clients using my webapp server ........for this we need to keep track of the sessions getting created .....................

But the problem is that if the user logsout properly then license system will be informed that one user is out .........but if one user closes the browser abruptly with out logging out ......then my license system has to wait till the session of that user expires ......................

I know that windows close event cant be caught( i am sure of this i hope) ........but is there anyway of informing the server that the user has closed his browser ................

If not above is there anyway from the server to ping back to all the active sessions and findout if the browser is opened r closed and then invalidate the session.................


Any help on this would be highly appreciated
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you ever been stuck in a string of pop-up ads where you close one and it opens another? It is possible.

The only thing I can think of is to use javascript to detect a window close in the pages that are only accessible to logged-in users. This detection would trigger a pop-up window to open. The pop-up's request will clean up the session on the server and send back a page telling the user that they should play nice and log out next time (even though it's taken care of).

The drawbacks to this approach is that a browser with javascript turned off or with a pop-up blocker might prevent it from working.
 
sreenath reddy
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi marc

the tough thing is that how to detect the window close event is the main problem any idea on this ???
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My suggestion is to browse the web until you get stuck in a bunch of naughty pop-ups and view the source to see what the javascript looks like.

Just kidding.

I think there is an onUnload attribute for the body tag but I am not sure which browsers support it.
reply
    Bookmark Topic Watch Topic
  • New Topic