When I login my users, I do it like this:
$logkey = md5(uniqid());
$_SESSION['user'] = array(
'id' => $udata['id'],
'username' => $udata['username'],
'logkey' => $logkey
);
setcookie('uid', base64_encode($udata['id']),(time()+2592000));
setcookie('ulogkey', $logkey,(time()+2592000));
setcookie('rmu', $udata['rmu'],(time()+2592000));
Although I've set the session to a month from when they login, I sometimes get logged out after 10 minutes, or when I close the browser.
What am I doing wrong?