I have created a single page website where users need to login to. The time users are on this page can differ, they have to make a selection of products which might take from 15 minutes to a couple of hours.
After the selection is completed, the selection is send by e-mail with using an AJAX call to send the e-mail. In this AJAX call the $_SESSION['user_id']
is used to identify the user, so we know from who the selection is comming.
If the user takes longer then 1440 seconds (24 min) the session expire. Now I changed the session timeout to 3 hours, but the problem still exists. I hardly can't imagine that someone takes longer than 3 hours. But they probably do. Maybe the users loges in, does some groceries and continues.
So how would I be able to fix this problem? I thought of using a AJAX call every 5 minutes in the hope the session timeout time will be reset. But I don't know if that works and if that is the way to fix this issue.