Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2004, 04:46 AM
Authorized User
 
Join Date: Feb 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to close a browser session ?

Hello,
I am using the Tomcat Formed-Authentication. Now, I know that the login page will pop-up only once per browser session. When the user exits the application, I want that the next time he enters, the login page pops-up
again. To do this, I suppose I have to close the browser application when
he exits the application.
Any idea of how to do it?
Thanks
ELisabeth

 
Old April 10th, 2004, 06:23 PM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nicku
Default

If it doesn't it means the session has not expired yet (default: 30min). 2 solutions: make the exp timeframe shorter, or better if u can signal the server on main wnd browse closed (u can use onBeforeUnload on same base object like the base frameset or body which the case may be, or window? try it out) and than session.invalidate() if i recall the syntax, anyway, you can find it. One more thing: if the user is already authenticated and resumes "attacks" after that short while isn't ok to skip the login and get to business? only if it doesn't confuse him i guess..:)

-------------
Nicu Marasoiu
java programmer
 
Old April 11th, 2004, 11:30 PM
Registered User
 
Join Date: Apr 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dear elisabeth,
I understood ur problem like this,
When the user exits the application, i.e when he logs out of the application, u want the session to be invalidated right?..
If that is the case, you call session.invalidate(). against the logout click.

Or if you want the session to be invalidated and fresh login to be popped up, when the user exits out of the application without a logout request, i.e if he closes the browser and reopens it, better use a client side script to call a jsp/servlet to invalidate the session. There are certain event handlers that can be invoked before closing thewindow. events like onUnload(), onClose() will work out. Try for the syntax of these events... sorry for not providing the syntax..

regards
Rammohan
J2EE Programmer.










Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser close when screen saver close Rehanrana Pro VB 6 1 April 7th, 2008 03:09 AM
Close Browser Window MoisesZaragoza Javascript How-To 2 February 6th, 2007 08:02 PM
How to close browser window? rupen Javascript How-To 14 July 31st, 2006 10:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.