0

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?

oliverbj
  • 5,771
  • 27
  • 83
  • 178
  • 'sometimes'? is not clear, did you check your configuration for php session timeout? check this-> http://stackoverflow.com/questions/8311320/how-to-change-the-session-timeout-in-php – Sagar Guhe Sep 20 '14 at 14:09
  • read this:http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes – Suchit kumar Sep 20 '14 at 14:18

0 Answers0