Re: Cookies Vs Sessions...?
| From: | Chris Shiflett | Date: | Fri, 03 Oct 2003 15:57:17 +0000 |
| Subject: | Re: Cookies Vs Sessions...? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164929@lists.php.net to get a copy of this message | ||
--- Eugene Lee <list-php-1@fsck.net> wrote:
> > setcookie("logged", "yes");
> >
> > On each protected page, put an IF ($logged == "yes") { //show page etc }
> > else {//show login form etc }
>
> You should use $_COOKIE['logged'] instead. :-)
While we're talking about "should", you should also never trust what the client
sends, including cookies. :-)
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp