RE: [PHP] cookie problem. Not possible to set and read a cookie o n the same page?

From: Date: Tue, 26 Mar 2002 16:53:42 +0000
Subject: RE: [PHP] cookie problem. Not possible to set and read a cookie o n the same page?
Groups: php.general 
Request: Send a blank email to php-general+get-90224@lists.php.net to get a copy of this message
Direct answer: No, you cannot read a cookie on the same page that creates it. The question is: why would you want to? After all, you already have the data available to you that you would read from the cookie because you had to use it to create the cookie on that page. -----Original Message----- From: andy [mailto:news.letters@gmx.de] Sent: Tuesday, March 26, 2002 10:39 AM To: php-general@lists.php.net Subject: [PHP] cookie problem. Not possible to set and read a cookie on the same page? Hi there, I am wondering if it is possible to send a cookie and read it on the same page. Following environment: There is a cookie already on the machine of the client, but expired. Now I am setting a new cookie and reading it on the same page via $sess_id = $HTTP_COOKIE_VARS[$sesscookiename]; Unfortuanaelly it gives me the old session id back. After refreshing I am getting the new sessid and everything works fine. The cookie has been sent with the right value, I did dubble check it. But the HTTP_C... reads the old one. why? Thanx for any help, Andy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#90224) next »