I have set session timeout value 5 mins(300 sec). Below is the code.
if(isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 300)) {
// last request was more than 5 minates ago
session_destroy(); // destroy session data in storage
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
I have a form and it will take more than 5 mins to filled it. When user submit it session get expired.
How I can maintain the session expiration time at the time of filling a form?