I check the status of the user - regardless of whether he is active or not - on the web page (in a pop-up window). in case it has been idle for more than 30 minutes, the window will automatically close and reset some flags in the database.
I set cookies containing time (at the moment when it opens a pop-up window) and checks it for the current time each time a page is refreshed or it goes to another page (still in a pop-up window). besides cookies, I also set the time in the database (in case the pop-up window is not open, the cron task will take care of resetting the flags by checking the time of entering the database).
there may be a case when he types something in the window, and the page does not load for 30 minutes, so the window automatically closes and he loses his job. so I added a function so that every onkeydown and onclick event is updated with a time value in both the cookie and the database.
there may also be more than one person who uses the system.
will it consume too many resources? I am not familiar with things related to this issue. or is there a better way to do this?
thanks!
source
share