Typically, you set a timestamp for the expiration of your session identifier cookie. When the cookie cannot be sent, the client will log out (without the given session identifier).
This method is often combined with JavaScript and another timestamp. When the timers begin to work, a notification is sent that allows the user to "update" his session ... essentially by making a request before the session expires.
The "refresh" request can be anything, even something as simple as loading an image.
source share