NYCPHP Meetup

NYPHP.org

[nycphp-talk] Cookie

Michele Waldman mmwaldman at nyc.rr.com
Thu Mar 19 09:11:16 EDT 2009


I was defined in the subdirectory, but not the root directory.

So, I don't think it was an expiration problem.

Michele
-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Scott Mattocks
Sent: Thursday, March 19, 2009 9:06 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Cookie

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
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php




More information about the talk mailing list