Image

Imagekriona wrote in Imagephp

How do you test if a visitor supports cookies?

get_browser() is disabled on my server.

setcookie - when successful, it sets a cookie, but the $_COOKIE array doesn't get updated until the next page, so you can't try and set a cookie and then check the array. setcookie will only return false if headers have already been sent, so you can't check if(setcookie(args)).


The goal? One, just to know if there's a way to tell if a visitor supports cookies, but really, tracking unique visits. Would I have to do something like this?
Step 1: if there's no cookie, set cookie to 1.
Step 2: if cookie equals 1, record unique visit, set cookie to 2

This of course means unique visits are only recorded on the second pageload.

Another / a better way?