Re: Making coockies valid for multiple domains possible?
| From: | Pavel Janda | Date: | Mon, 12 Jan 2004 09:22:02 +0000 |
| Subject: | Re: Making coockies valid for multiple domains possible? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174295@lists.php.net to get a copy of this message | ||
"Merlin" <news.groups@web.de> píse v diskusním príspevku
news:20040112085644.65820.qmail@pb1.pair.com...
> Hello everybody,
>
> I am working on translating my site into multiple languages (i18n). Each
> different language is hosted on the same server, but on a different
> subdomain.
>
> example:
> de.server.com - german
> en.server.com - english
>
> Here comes the problem. Sessions are validated through coockies on my
> site. The system checks if the coockie is valid and compares it with a
> sessionid inside the database.
>
> It seems to me that coockies are only valid for one domain for security
> reasons.
>
> QUESTION:
> Is there a way to make that coockie valid for multiple domains?
Yes, it is...
See: http://cz.php.net/manual/en/function.setcookie.php
When you set parametr domain to ".server.com" - see carfully, there are two
dots :) - the cookie will be available for all subdomains...
PJ
>
> Thank you for any help on that.
>
> Regards,
>
> Merlin