note 74046 deleted from function.setcookie by crell

From: Date: Tue, 12 Apr 2022 00:37:19 +0000
Subject: note 74046 deleted from function.setcookie by crell
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-218154@lists.php.net to get a copy of this message
Note Submitter: ---- 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.

« previous php.notes (#218154) next »