Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
double cookie mystery
I have some interest in tracking people across my website, mostly to see who is not human. I added the following code to all pages:
<txp:php>
if ( isset( $_COOKIE["bot"] ) )
$counter = 1 + (int) $_COOKIE["bot"] ;
else
$counter = 1 ;
setcookie( "bot", (string) $counter, 0 ) ;
</txp:php>
Then after I wandered about the site, clicking on some random pages, I looked at the cookies:
Cookie: bot=9; txp_login_public=...other cookies...; bot=4
The issue is repeatable. I cleared all cookies from the browser and tried again – same result: two “bot” cookies. How did I end up with the same cookie twice?
Offline