Hello i have a built a user management system for my project.
i am workin with php programming language.
furthermore my aim here is to keep users logged in for at least a year unless they decide to logout themsleves.
so what have i done?
i increased the session.gc_maxlifetime to "31536000" from my cpanel where my project is hosted.
my second action was to then create a session time to match the gc_maxlifetime i have set.
which i read up from here
https://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes
if (!isset($_SESSION['CREATED'])) {
$_SESSION['CREATED'] = time();
} else if (time() - $_SESSION['CREATED'] > 31536000) {
session_regenerate_id(true);
$_SESSION['CREATED'] = time();
}
my issue is i still get logged out dew minutes later.
please how can i make sure my users are logged in for a period of time using
the session.gc_maxlifetime