Send to a Friend

gagara's avatar

How to make cookie in php track both in www.site.com and site.com for some web-site?

Asked by gagara (102points) May 11th, 2010

I am making website in php where I track users via cookies. For brevity reasons users are normally directed to http://site.com (not the actual site, just example), but I cannot exclude users navigating also from http://www.site.com. I am having trouble creating cookies that can be tracked both from site.com and www.site.com in PHP, as PHP creates cookie in either domain, and it is not visible in the other domain. What should I do?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.