Re: Problem with cookies

From: Date: Sat, 24 Mar 2001 01:28:37 +0000
Subject: Re: Problem with cookies
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-45390@lists.php.net to get a copy of this message
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" <wx@wxcs.com> 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

« previous php.general (#45390) next »