How to handle user online status when he/she close the browser?

后端 未结 5 974
自闭症患者
自闭症患者 2021-01-06 01:47

I am having table to track user online status by setting \'is_online\' field to 1. Now User get logged in the site and shut down his/her system or power down at that time he

5条回答
  •  不知归路
    2021-01-06 02:10

    Due to the stateless nature of the web it is not possible to know exactly when the user left your website. So you can't really trigger any code to change the mentioned value.

    As the other have said one has to store the time-since-last-activity to get an approximate idea when was the last time the user was actually doing something with the website.

    HTH :)

提交回复
热议问题