Home > Mobile >  Can we capture Logout timestamp if the user closes browser or shutdown in php?
Can we capture Logout timestamp if the user closes browser or shutdown in php?

Time:02-17

If it possible what be the steps? If not what are the possible steps? In my overall project: I'm using session so that users session in that application is tracked if they logs out as followings

id|session|login_time_stamp|logout_time_stamp
---------------------------------------------
1 |xgy67sw|   date-time    | date-time

But if they Shutdown pc or closes browser, logout time stamp is null.

id|session|login_time_stamp|logout_time_stamp
---------------------------------------------
1 |xgy67sw|   date-time    | null

What I want is, if the users closes browser or PC how to grab their exiting timestamp?

CodePudding user response:

What you want is not possible.

Maybe you will want to read these topics:

Want to detect browser close event

How to store log time when the user closed the browser

CodePudding user response:

There is no reliable way to capture when a user logs out of a website. Sessions expire after a certain time period has elapsed, but there is no reliable way to know when a user actually closes their browser or shuts down their computer.

  • Related