NYCPHP Meetup

NYPHP.org

[nycphp-talk] Cookie

Scott Mattocks scott at crisscott.com
Thu Mar 19 09:05:37 EDT 2009


Michele Waldman wrote:
>>From http://domain/accout/login.php, if did setcookie('logged_in", "1",
> $path="/");, like the documentation said too.
> 
> Does anyone know what I'm doing wrong here?

You mean other than relying on that cookie to tell you if the user is 
logged in? Yeah, you are missing the expire parameter and assigning a 
variable where you should just be setting the value (I know it will 
work, but it isn't a good idea).

Try: setcookie('logged_in', 1, 0, '/');

-- 
Scott Mattocks
Author: Pro PHP-GTK
http://www.crisscott.com



More information about the talk mailing list