Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Yesterday 18:50:41

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 233
Website Mastodon

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

Board footer

Powered by FluxBB