Set cookies for multiple domains

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Set cookies for multiple domains

Post by pickle »

I've built a webportal on one of my subdomains, let's say M. I've got a bunch of other servers at a different domain, let's say C. When a user logs into M, is there any way for me to get the authentication cookie set on C? I know I can't call setcookie() on M & set a cookie on C.

I've set up a PHP file on C that is loaded as an image once the user logs in to M. That successfully propagates the cookie info in Firefox. IE8 though, refuses to co-operate (what a shock). If I access the PHP file on C directly, the cookie does propagate properly.

Checking the Developer Tools Image Report in IE, it says the propagating image is broken. That's fine - it would appear that the request for the file is still made though. Why then, is the cookie not propagating?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply