I have tried to set a cookie that can last for 6 months on users' computers one they log in to the system using:
$_SESSION["loginUsername"] = $user;
$inSixMonths = 60 * 60 * 24 * 180 + time();
setcookie('lastVisit', date("G:i - m/d/y"), $inSixMonths);
I don't want users to log in to my website whenever they restart their browser or even their computers, although, I know it is a security risk.
For some reason, when I'm logged in to the system and don't have any activities for a while, all session variables expire so that I have to log in again.
I have found some tricks to increase session's time out value by modifying php.ini, but I'm just wondering if it's possible to do that using php codes, since I don't have access to php.ini ?
Thanks in advance