Log out in closing
-
hi i need to log out when the user close the explorer by click (X)button
ahmed eldeghedy
-
hi i need to log out when the user close the explorer by click (X)button
ahmed eldeghedy
You can capture the event when user closes the browser in Javascript,and from that you can call some server side code to logout from the session. One thing,if you close the browser then also after sesstionout time user automatically logs out.So if no specific requirement like secuirty or some logs for it,then you can use above one else you don't need to care about it.
Cheers!! Brij
-
hi i need to log out when the user close the explorer by click (X)button
ahmed eldeghedy
ahmed eldeghedy wrote:
i need to log out when the user close the explorer by click (X)button
if(window.event.clientX < 0 && window.event.clientY <0) { Alert("Browser Closing"); }
Call this from
onunload
of body :)cheers, Abhijit CodeProject MVP My Blog :Abhijit's World of .Net
-
hi i need to log out when the user close the explorer by click (X)button
ahmed eldeghedy
You can capture the event in js and use AJAX to tell your app that it happened. But even then, I would not trust it 100%, I would never write code that relies on the user logging out, I'd impliment a timeout for users who manage to leave my site without me knowing.
Christian Graus Driven to the arms of OSX by Vista.
-
You can capture the event in js and use AJAX to tell your app that it happened. But even then, I would not trust it 100%, I would never write code that relies on the user logging out, I'd impliment a timeout for users who manage to leave my site without me knowing.
Christian Graus Driven to the arms of OSX by Vista.
Christian Graus wrote:
I would not trust it 100%, I would never write code that relies on the user logging out, I'd impliment a timeout for users who manage to leave my site without me knowing.
That's perfect :)
cheers, Abhijit CodeProject MVP My Recent Article : Exploring Session in ASP.Net
-
You can capture the event in js and use AJAX to tell your app that it happened. But even then, I would not trust it 100%, I would never write code that relies on the user logging out, I'd impliment a timeout for users who manage to leave my site without me knowing.
Christian Graus Driven to the arms of OSX by Vista.
in the first thank you i know what you speaking about but i am a developer not a customer and that a customer request and i can not change his beliefs note ---- the question not for log out specially i am sorry it for how to open connection with data base thanks for your help again
ahmed eldeghedy