Any and all help is greatly appreciated!
2. In that window, check the opener property to see if the original window is still open.
If it is open, means the user hasnt closed the browser, something else triggered the onUnload event, do nothing.
If it is closed, call the servlet code to do whatever u want to do
3. Close the new window.
I never tried it throughly, you might want to think along those lines.
and you may find some ideas in this discussion
2. From a requirements standpoint, I simply want to manage server resourses wisely. There will be many users hitting my server and therefore the memory footprint may be large. If something is no longer needed, I'd like to free the resources when I know they are no longer needed. I can do this if they click my button that says "I'm done" but I cannot prevent them from simply closing the browser window or navigating to another site.
Thanks to everyone for their feedback!
session.invalidate() to release all objects bound to the session. I do it with an "Exit" button, but you can just as easily call a jsp page with onunload="invalidate.jsp" in the body tag.
My invalidate.jsp simply contains:
to logout from the page. but it seems like it doesn't work...
can someone help me???
here is the code...
<%@ page contentType="text/html" %>
<%@ page session="true" %>
Originally posted by D Rog:
Why wouldn't you just use the built-in session timeout support?
1. wizards, it assumes using several screens, of course it's better solution to keep state of wizard in hidden fields, but sometime session is more preferable. So, if user left wizard and continue working on other screens, wizard state remains in session.
2. work in single sign on environment, Siteminder agent manages user logins and requires to have no time out for sessions.
3. Some other examples you can give me from your experience.