• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Killing session objects when browser window closes

 
Richard John
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an app that opens a second browser window to carry out a set of tasks, this window creates a session object. It needs to be session bound as there are a number of phases to go through to complete the task. When that browser window closes i want to set that session object to null. Unfortunately i can't seem to get rid of it. Anyone got any ideas how I can do this?
Thanks for any help.
Rich
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless you can figure out a way to force this second window to send a message to the server when it closes, or use some sort of "keep-alive: heartbeat, there is no way for the server to know when the window closes.
You could set a short expiration time with
setMaxInactiveInterval( int seconds );
and use a cycling Javascript method to send the heartbeat.
Bill

------------------
author of:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic