Session_end or browser close events?
-
Hi, On a site where users log in with username and password. How do I force a logout event to run before the application closes OR BROWSER IS CLOSED? I know about session_end, but that doesnt help when the browser is just closed! I really need to run an event to do a DB query before a user loggs out! Please help. Regards, Tintin
-
Hi, On a site where users log in with username and password. How do I force a logout event to run before the application closes OR BROWSER IS CLOSED? I know about session_end, but that doesnt help when the browser is just closed! I really need to run an event to do a DB query before a user loggs out! Please help. Regards, Tintin
Not sure got your clue... But if you just want to close the user session, just simple call Session.Abandon()... << >>
-
Hi, On a site where users log in with username and password. How do I force a logout event to run before the application closes OR BROWSER IS CLOSED? I know about session_end, but that doesnt help when the browser is just closed! I really need to run an event to do a DB query before a user loggs out! Please help. Regards, Tintin
There is not sure way to do that. You can catch the onunload event in the browser, and open a new window that will run a page where you can do your database work. Of course that doesn't work if Javascript is disabled in the browser, or if a popup blocker stops the window. Unless the browser tells the server that it's closing, there is no way that the server can know when the browser closes. The closest thing that you can get is to have the web page send requests to the server at a certain interval, so that the server can detect when there are not coming any request any more. --- b { font-weight: normal; }
-
There is not sure way to do that. You can catch the onunload event in the browser, and open a new window that will run a page where you can do your database work. Of course that doesn't work if Javascript is disabled in the browser, or if a popup blocker stops the window. Unless the browser tells the server that it's closing, there is no way that the server can know when the browser closes. The closest thing that you can get is to have the web page send requests to the server at a certain interval, so that the server can detect when there are not coming any request any more. --- b { font-weight: normal; }
Guffa can u please postthe code to check "send requests to the server at a certain interval, so that the server can detect when there are not coming any request any more" Is it Submit page through Java Script at certain interval?