jason101799
asked on
How to detect a window being close????
Experts,
I wanted to know how to detect a user closing an existing window. This window contains frames. Actually I am working on the security part, whenever a user login I will set an indicator to 1 in the database so that the user cannot login again from another browser. When the user click logout or session timeout I will set this indicator to 0 so that he can login again later. But the biggest problem is how to set the indicator to 0 when a user closes the window?????
I will be grateful if you can provide expert advice.
Cheers
Jason
I wanted to know how to detect a user closing an existing window. This window contains frames. Actually I am working on the security part, whenever a user login I will set an indicator to 1 in the database so that the user cannot login again from another browser. When the user click logout or session timeout I will set this indicator to 0 so that he can login again later. But the biggest problem is how to set the indicator to 0 when a user closes the window?????
I will be grateful if you can provide expert advice.
Cheers
Jason
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can open a new window. Once the x-button has been clicked, you will go to the page that will set your counter to zero or that will abandon the session(ASP page)....
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is has been interupted then you'll have a problem...
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is has been interupted then you'll have a problem...
You can open a new window. Once the x-button has been clicked, you will go to the page that will set your counter to zero or that will abandon the session(ASP page)....
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is interupted, then you'll have a problem...
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is interupted, then you'll have a problem...
You can open a new window. Once the x-button has been clicked, you will go to the page that will set
your counter to zero or that will abandon the session(ASP page)....
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is has been interupted then you'll have a problem...
your counter to zero or that will abandon the session(ASP page)....
<html>
<script>
function gio()
{
alert('This will bring you to the logout page!');
window.open('ASP page');
}
</script>
<body onunload="gio()">
Code....
</body>
</html>
...if the modem is has been interupted then you'll have a problem...
virus05 - please read the EE guidelines on proposing answers.
Feel free to reject the answer jason, in order to unlock the question and allow a greater level of feedback from experts.
Ant
Feel free to reject the answer jason, in order to unlock the question and allow a greater level of feedback from experts.
Ant
Please return and update/finalize this question, it is ancient.
Expert input welcome if I must decide the outcome.
EE Moderator
Expert input welcome if I must decide the outcome.
EE Moderator
It seems I never came back and responded to the last question posted by jason - sorry about that.
Not sure if jason still needs help with this.....
Ant
Not sure if jason still needs help with this.....
Ant
jason@lc,
These questions are still open. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20167319
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20153401
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20151128
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20146743
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20150594
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20245522
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20239352
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20166221
https://www.experts-exchange.com/jsp/qShow.jsp?ta=xml&qid=20243323
https://www.experts-exchange.com/jsp/qShow.jsp?ta=exchangesvr&qid=20240796
EXPERTS: Please leave your thoughts on this question here.
Thanks,
Netminder
Community Support Moderator
Experts Exchange
These questions are still open. Please resolve them appropriately as soon as possible. Continued disregard of your open questions will result in the force/acceptance of a comment as an answer; other actions affecting your account may also be taken. I will revisit these questions in approximately seven (7) days.
https://www.experts-exchange.com/jsp/qShow.jsp?ta=win2k&qid=20167319
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20153401
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20151128
https://www.experts-exchange.com/jsp/qShow.jsp?ta=java&qid=20146743
https://www.experts-exchange.com/jsp/qShow.jsp?ta=javascript&qid=20150594
https://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20245522
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20239352
https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20166221
https://www.experts-exchange.com/jsp/qShow.jsp?ta=xml&qid=20243323
https://www.experts-exchange.com/jsp/qShow.jsp?ta=exchangesvr&qid=20240796
EXPERTS: Please leave your thoughts on this question here.
Thanks,
Netminder
Community Support Moderator
Experts Exchange
Admin notified of User neglect. Force-accepted by
Netminder
Community Support Moderator
Experts Exchange
Netminder
Community Support Moderator
Experts Exchange
ASKER
I am trying to understand your suggestion. Can you elaborate coz I am lost. I am kinda slow :)
My concern is whenever a user click on closes the window by clicking the "x" at the top right corner of the browser I will call a function (ASP codes) to update my login indicator to "N". At least the user can login in again later.
One more question, what if the modem line got cut off and the user reboots the PC?? Can I consider the window being closed?? Will the Web Server knows that this session is ended??
Thanks
Cheers
Jason