Re: Cookie effect

From: Date: Sat, 12 May 2001 09:34:20 +0000
Subject: Re: Cookie effect
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-9267@lists.php.net to get a copy of this message
David > problem is, the cookie only comes into effect after I've clicked thru to > another page from login.php...any ideas on this? You don't explain why you need to access the cookie immediately. If you just want to check it has been accepted, the usual approach is to use headers to do a redirect back to the same script. Then you can check if the cookie is there. You need to use a POST or GET variable to indicate whether you are in cookie writing or cookie checking state. If this is a public site, be aware that some search engine bots don't like fast redirects and will not index anything below this script on the site. You can also do this with JavaScript I believe - not very reliable on the open web though as it may be missing/turned off in the target browser. If you look at the archives for the general mailing list you will find some sample code. Hope this is useful Geoff Caplan

« previous php.db (#9267) next »