On my website to make user to log in I create session, where I save mail and md5(password).
If while login the checkbox "remembmer me" is checked I do the folowing:
if(isset($_POST['remme']) && $_POST['remme'] == '1'){
ini_set('session.gc_maxlifetime', 604800);
ini_set('session.cookie_lifetime', 604800);
setcookie('PHPSESSID',$_COOKIE['PHPSESSID'],time()+604800); //The only string, which works
}
session_start();
By this way I solved the problem of session dieing when users restarts the browser.
But I still have a problem: session still lives only 24 minutes. What should I do to prevent session diening.
P.S. I have an apache2 server.
Sorry if it's a old question. I just can't find an answer..