это надо писать и на поддомене, и на главном домене.На поддомене пишу
такие параметры можно ставить, если открывается страница на http://site.com. Если будет http://www.site.com, а кука ставится на .site.com (на весь домен site.com и все поддомены этого сайта), то браузер отвергнет эту куку.Автор оригинала: Focus
PHP:session_set_cookie_params(0, '/', '.site.com');
Домен "www.example.com" (N == "www") совпадает с ".example.com" согласно 3-му пункту.Hosts names can be specified either as an IP address or a FQHN
string. Sometimes we compare one host name with another. Host A's
name domain-matches host B's if
* both host names are IP addresses and their host name strings match
exactly; or
* both host names are FQDN strings and their host name strings match
exactly; or
* A is a FQDN string and has the form NB, where N is a non-empty name
string, B has the form .B', and B' is a FQDN string. (So, x.y.com
domain-matches .y.com but not y.com.)
2-й пункт, как я понимаю, запрещает домены типа "localhost", "com", ".com", "com.", т.к. там нет _внутри_ точек. Правильно я понимаю «embedded dots»?4.3.2 Rejecting Cookies
To prevent possible security or privacy violations, a user agent
rejects a cookie (shall not store its information) if any of the
following is true:
* The value for the Path attribute is not a prefix of the request-
URI.
* The value for the Domain attribute contains no embedded dots or
does not start with a dot.
* The value for the request-host does not domain-match the Domain
attribute.
* The request-host is a FQDN (not IP address) and has the form HD,
where D is the value of the Domain attribute, and H is a string
that contains one or more dots.
Examples:
* A Set-Cookie from request-host y.x.foo.com for Domain=.foo.com
would be rejected, because H is y.x and contains a dot.
The domain that the cookie is available to. To make the cookie available on all subdomains of example.com (including example.com itself) then you'd set it to '.example.com'. Although some browsers will accept cookies without the initial ., » RFC 2109 requires it to be included. Setting the domain to 'www.example.com' or '.www.example.com' will make the cookie only available in the www subdomain.
ну кто спорит-то? Я же написал про установку кук.Автор оригинала: Gas
korpus
не нужно вводить в заблуждение, кука .domain.com ставится/читается и на www.domain.com, и на www.sub2.sub1.domain.com. Не играет роли какие сабдомены стоят слева от точки.
— а это значит, что все плевать хотели наАвтор оригинала: Gas
Не играет роли какие сабдомены стоят слева от точки.
4.3.2 Rejecting Cookies
To prevent possible security or privacy violations, a user agent
rejects a cookie (shall not store its information) if any of the
following is true:
...
* The request-host is a FQDN (not IP address) and has the form HD,
where D is the value of the Domain attribute, and H is a string
that contains one or more dots.
Examples:
* A Set-Cookie from request-host y.x.foo.com for Domain=.foo.com
would be rejected, because H is y.x and contains a dot.