Logged in and logged out.
-
In my aplication I've to trace logged in and logged out for an user. I've created a table that contains information about logged in and logged out time of an user. whenever an user logged in i simply add a record in this table and when user logged out i simply update this table. now suppose that when a user close its browser by clicking on cross icon of browser or after a session time out then in this case user logically time out. then in this case how i update table for user logged out?
-
In my aplication I've to trace logged in and logged out for an user. I've created a table that contains information about logged in and logged out time of an user. whenever an user logged in i simply add a record in this table and when user logged out i simply update this table. now suppose that when a user close its browser by clicking on cross icon of browser or after a session time out then in this case user logically time out. then in this case how i update table for user logged out?
Handle the Browser Close using Java script, Open a popup on Browser close and in the code behind, do the server side stuff for update the data and then close the popup. This will resolve your issue.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
In my aplication I've to trace logged in and logged out for an user. I've created a table that contains information about logged in and logged out time of an user. whenever an user logged in i simply add a record in this table and when user logged out i simply update this table. now suppose that when a user close its browser by clicking on cross icon of browser or after a session time out then in this case user logically time out. then in this case how i update table for user logged out?
-
Handle the Browser Close using Java script, Open a popup on Browser close and in the code behind, do the server side stuff for update the data and then close the popup. This will resolve your issue.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
2489128 wrote:
How can I Handle the Browser Close using Java script? plz help me.
function DeleteUserLog()
{if(window.event.clientX < 0 && window.event.clientY <0) { window.open("CloseSession.aspx", "OpenWindow\_Close\_Session",'left=12000,top=1200,width=10,height=1'); } }
and on CloseSession.aspx page do the staff.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
modified on Friday, May 1, 2009 5:42 AM
-
2489128 wrote:
How can I Handle the Browser Close using Java script? plz help me.
function DeleteUserLog()
{if(window.event.clientX < 0 && window.event.clientY <0) { window.open("CloseSession.aspx", "OpenWindow\_Close\_Session",'left=12000,top=1200,width=10,height=1'); } }
and on CloseSession.aspx page do the staff.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
modified on Friday, May 1, 2009 5:42 AM
-
if you have the master page you can call it on Body Unload if you dont have the master page you have to give it on body unload of all form (If page number is very less ) other wise developed a Handler to do the stuff. Cheers !!
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
-
Handle the Browser Close using Java script, Open a popup on Browser close and in the code behind, do the server side stuff for update the data and then close the popup. This will resolve your issue.
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
Unless they have popups blocked?
-
Unless they have popups blocked?
never trust that your popup will go though use a web service or a hidden iframe ... free hand didn't test this code var iframe = docuemnt.createElement("iframe") docuemnt.body.appendChild(iframe); iframe.setAttribute("src", "logOut.aspx");
Take a look at my corner of the net at Code Research Center
-
if you have the master page you can call it on Body Unload if you dont have the master page you have to give it on body unload of all form (If page number is very less ) other wise developed a Handler to do the stuff. Cheers !!
cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net
hi. i have put this code in window.onload event: window.event.clientX < 0 && window.event.clientY <0 and on clicking browser's close button we always find window.event.clientY < 0 and window.event.clientX > 0. so i'm unable to track browser's close event.
-
never trust that your popup will go though use a web service or a hidden iframe ... free hand didn't test this code var iframe = docuemnt.createElement("iframe") docuemnt.body.appendChild(iframe); iframe.setAttribute("src", "logOut.aspx");
Take a look at my corner of the net at Code Research Center
-
add the code from my last post the window.onbeforeunload event
Take a look at my corner of the net at Code Research Center