Forum Moderators: coopster

Message Too Old, No Replies

setcookie - is this the way to do it?

         

hound_dog

2:14 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



Would appreciate some help with this php cookie thing:

setcookie("name", "", time()+604800);

I just want to use cookies to track visitors. Would the above work, or do I have to somehow give a value? I will be reading the cookie using a logfile analyser.

jatar_k

3:41 pm on Jul 10, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



that line should work but you will have no way of differentiating between users with out a value.

hound_dog

4:55 pm on Jul 10, 2005 (gmt 0)

10+ Year Member



this is what I cant figure out... how do I give it a value? Just something unique like a number etc so that I can track unique visitors...

jatar_k

4:59 pm on Jul 10, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



defining a way to uniquely identify users is always a difficult thing to do

ips aren't unique
user agents aren't unique

there isn't much we can find out about users when they aren't logged in.

this thread in the tracking & logging forum may help, it's a very good read
How to track visitors [webmasterworld.com]

hound_dog

10:08 am on Jul 13, 2005 (gmt 0)

10+ Year Member



when a well-known website visitor analysis software says they use cookies to track unique visitors, my question is: how are they doing it?

jatar_k

5:10 pm on Jul 13, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



with a ton of cross referencing, though the other answer is 'not very well'

unique visitors is seldom accurate, too low and visits is seldom too high, the real number from most commercial tracking software lies between the 2 numbers