My cookies won't stay (PHP).

Posted by RemiX on Stack Overflow See other posts from Stack Overflow or by RemiX
Published on 2010-05-04T14:39:57Z Indexed on 2010/05/04 15:38 UTC
Read the original article Hit count: 141

Filed under:
|
|
|

I'm building an autologin system using cookies, but one fundamental part of the functionality of the cookies fails: they are non-persistent over different sessions - or even pages! In my login script, I set the cookies like this:

setcookie('userID', $userID, time()+86400); // (edited after replies)

$userID has a value.
Then I print the $_COOKIE variable and it says array(['base_usid'] => 1); So that's good, but when I click the home page and print the $_COOKIE variable there, it says NULL.
Does anyone see the problem?

© Stack Overflow or respective owner

Related posts about php

Related posts about cookies