View Full Version : 2 websites, 1 cookie?

05-01-2004, 10:27 AM
Is it possible to have two websites read the same cookie using PHP?

I currently have two sites, one has a forum, the other a utility I made. I would like for the utility website to be able to read cookes from my other site so I can see if people are logged in over there and customize the interface accordingly. Is this something which can be done?

05-01-2004, 11:21 AM
Cookies are domain specific --> only the domain that set them, should be allowed to read them (for obvious reasons)

So if both your 'sites' share the same domain, eand have like a subdomain or so, then it should be possible. If they both have their own domain, then it should not be possible.

But since you have a forum, i suppoe you have a db in place, so i would just keep that login-info in the db and check against that --> more universal + will always work, even if the sites are on a seperate domain.