RE: [PHP-WIN] Cookies
| From: | Jeroen ten Berge | Date: | Thu, 24 Aug 2000 16:58:59 +0000 |
| Subject: | RE: [PHP-WIN] Cookies | ||
| References: | 1 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-general+get-13468@lists.php.net to get a copy of this message | ||
Thanks for your (late ;)) reply,
but I get the cookie availlable as soon as I create a new page from within
my script, so all is working fine now ;)
Thx anyway.
Regards,
Jeroen.
-----Original Message-----
From: Pablo Vera [mailto:pvz@vercan.com]
Sent: Thursday, August 24, 2000 18:42
To: Jeroen ten Berge
Cc: Php-Windows; php-general@lists.php.net
Subject: Re: [PHP-WIN] Cookies
JtB> Hi all,
JtB> I'm having trouble with cookie use;
JtB> In this php script of mine I set a cookie :
JtB> setcookie($cook_ID,$randval,time()+3600,".",".ourdomain.com");
JtB> Now when I want to start another script, the current script stays
PHP_SELF
JtB> and so the other script will not take over the value from the cookie;
JtB> Even when I open this script manually the php_info won't show the
cookie
JtB> vars...
Jeroen:
How do you start the other script ? If you include() it or
require() it, the cookie will not be visible. You need to do
a redirect, with header("Location: other.php") or some other way,
to this other script, so that the cookie will be sent back by the
browser and made visible to the script.
From the PHP Manual, XX. HTTP Funtions, setcookie:
" Common Pitfalls:
Cookies will not become visible until the next loading of a page
that the cookie should be visible for. "
Saludos,
Pablo Vera
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net