Re: session cookie and domains
| From: | Richard Lynch | Date: | Fri, 05 May 2006 01:00:23 +0000 |
| Subject: | Re: session cookie and domains | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235595@lists.php.net to get a copy of this message | ||
On Thu, May 4, 2006 7:37 am, Merlin wrote:
> I am operating 3 sites where I would like to be able to login cross
> site. Means
> with one login have a valid session on all 3 domain.
>
> Currently I do set the cookie like this:
> setcookie($cookiename,$sessid,0,'/','.'.$domain[name],0);
>
> That makes is available for all subdomains. Is there a possiblity to
> make it
> available for all domains like example: .domainname.
You can't set/read cookies for other TLDs...
That would be a very giant security hole.
You'll have to find some other way to transfer authentication
cross-site, very carefully, to avoid exposing your application.
Plus, your $domain[name] is an E_NOTICE you are ignoring.
Assuming you did not do: define('name', ...);
Change php.ini to E_ALL and you'll write better code. :-)
--
Like Music?
http://l-i-e.com/artists.htm