note 76395 added to function.setcookie

From: Date: Fri, 13 Jul 2007 06:51:23 +0000
Subject: note 76395 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-128430@lists.php.net to get a copy of this message
if you are having problems seeing cookies sometimes or deleting cookies sometimes, despite following the advice below, make sure you are setting the cookie with the domain argument. Set it with the dot before the domain as the examples show: ".example.com". I wasn't specifying the domain, and finally realized I was setting the cookie when the browser url had the http://www.example.com and later trying to delete it when the url didn't have the www. ie. http://example.com. This also caused the page to be unable to find the cookie when the www. wasn't in the domain. (When you add the domain argument to the setcookie code that creates the cookie, make sure you also add it to the code that deletes the cookie.) ---- Server IP: 69.147.83.197 Probable Submitter: 76.109.26.101 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- https://master.php.net/note/edit/76395 Del: integrated -- https://master.php.net/note/delete/76395/integrated Del: useless -- https://master.php.net/note/delete/76395/useless Del: bad code -- https://master.php.net/note/delete/76395/bad+code Del: spam -- https://master.php.net/note/delete/76395/spam Del: non-english -- https://master.php.net/note/delete/76395/non-english Del: in docs -- https://master.php.net/note/delete/76395/in+docs Del: other reasons-- https://master.php.net/note/delete/76395 Reject -- https://master.php.net/note/reject/76395 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128430) next »