Page 1 of 1

How to prevent explorer from being closed.

Posted: Sat Nov 06, 2004 12:32 am
by renu
Hi
I want to ask for logout when user closes browser .and if user says no then browser should not be closed.I'm able to display alert message for logout but cant stop the explorer from being stopped.
Can anyone help me.
thanx

Posted: Sat Nov 06, 2004 12:41 am
by John Cartwright
Why not re-think you design so you dont have to resort to javascript.. as some people wont have it enabled.

Store their session in a database and crosscheck last activity, if passed a certain point log them out.

Posted: Sat Nov 06, 2004 2:24 am
by renu
Hi Phenom

Closing session is not a problem.but my requirement is tht when user close
the browser i want to ask him for logging out.if he doesn't logout then browser shouldn't be closed.
In short ,before closing the browser i want to put a check on tht event.

Posted: Sat Nov 06, 2004 5:36 am
by patrikG
apart from javascripts onUnload-event there is nothing you can do. And be grateful for it - imagine websites refusing to be closed until you've looked at their "special offers".

Posted: Sat Nov 06, 2004 8:01 am
by John Cartwright
renu wrote:Hi Phenom

Closing session is not a problem.but my requirement is tht when user close
the browser i want to ask him for logging out.if he doesn't logout then browser shouldn't be closed.
In short ,before closing the browser i want to put a check on tht event.
Oh if this was possible it would make all of our user authentication scripts better :)