Re: [Phplib-users] Multi-domain sessions?
Brought to you by:
nhruby,
richardarcher
|
From: Layne W. <la...@if...> - 2002-05-13 15:44:20
|
>> My initial attempt to do this involved hacking session4.inc >> so that if $cookie_domain is an array it sends a cookie from >> each domain listed but this doesn't appear to have worked. >> My sessions within one site have the same ID but when I move >> to either of the other sites I get a different ID. > > Just some general thoughts. First, you can't set or read cookies > from other domains. If you wanted to go that way, the only way to > really do it would be to set the cookie and redirect to the other > two domains, basically a redirect circle that would end up on the > first site again. > I wouldn't recommend that. Why not do what the banner ad placement companies like DoubleClick do? On each domain, link to an invisible 1x1 GIF from the other two sites. The image source url is actually a link to a PHP file with a session id using PATH_INFO or a GET variable. The image PHP script writes a session cookie to its own domain and then sends through the GIF. Layne Weathers Ifworld Inc. |