note 74046 added to function.setcookie

From: Date: Wed, 21 Mar 2007 22:40:30 +0000
Subject: note 74046 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-124691@lists.php.net to get a copy of this message
if you only want to do something once per unique visitor, you can test if a cookie is set, and if not, set the cookie and perform the action. This being the poorman's version, it has a problem, where if a user is blocking cookies they will appear as a first time visitor each time. What you can do to avoid this is to set a test cookie first and check that it exists. If it exists, then check to see if your second cookie has been set. If the first one is set, but the second isn't, then you know this is a first time visitor. ---- Server IP: 216.194.113.175 Probable Submitter: 64.17.250.94 ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- https://master.php.net/note/edit/74046 Del: integrated -- https://master.php.net/note/delete/74046/integrated Del: useless -- https://master.php.net/note/delete/74046/useless Del: bad code -- https://master.php.net/note/delete/74046/bad+code Del: spam -- https://master.php.net/note/delete/74046/spam Del: non-english -- https://master.php.net/note/delete/74046/non-english Del: in docs -- https://master.php.net/note/delete/74046/in+docs Del: other reasons-- https://master.php.net/note/delete/74046 Reject -- https://master.php.net/note/reject/74046 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124691) next »