PHP - how to detect broken session end datetime? -


usercase: need track user's duration on site. calculated (end datetime - start datetime). works fine if user clicks signout. system can record end datetime. issue in edge cases: user's session ends due - loss of internet connection @ user's end, browser closed, system went down, etc. in these cases how system know end datetime can calculate duration.need end datetime calculated close possible real datetime. if not possible upto 5 mins of accurate fine.

one possible way see keep pinging client system , check if active or not. dont want adds unwanted bandwidth. other way info edge cases?

why not check time of last pageview?

checking browser window open-time won't people me leave tabs open... not mention quite hard cover of edge-cases (browsers don't support js, people behind proxies, etc). last pageview should accurate few minutes, , have least overhead/complexity while still maintaining decent level of accuracy...


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

sql server - python to mssql encoding problem -

windows - Python Service Installation - "Could not find PythonClass entry" -