When you SET a cookie, the browser has the cookie, but it has not been sent
back by the browser to the server yet -- Only on the second page does that
happen.
So, in addition to setting a cookie, you should also set the variable at the
same time.
--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "wx" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Friday, March 23, 2001 6:00 PM
Subject: [PHP] Problem with cookies
Hello:
I've set up a authentication script in PHP, and have made it to where
once the user has been successfully authenticated, it puts the username
($global[username]), password ($global[password]), and realname
($global[realname]) into a cookie. The included functions file
(./inc/common.inc) does this, my problem is:
Once it has been authenticated, the main page (index.php) goes through
an if statement for the variable $authok, if $authok is "1", then display
the main page, elseif $authok != 1, then display login, it displays the main
page fine except, the realname and the username don't show up, until I
reload the page and the realname and the username then show up. I don't
understand why it is doing this. Please if you can, help me fix this.
Thanks a lot
Rob Vella
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]