Doc #71106 [Csd]: Unclear explanation of cookie-domain
| From: | david dot bruchmann at gmail dot com | Date: | Fri, 18 Dec 2015 19:40:10 +0000 |
| Subject: | Doc #71106 [Csd]: Unclear explanation of cookie-domain | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12973@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71106&edit=1
ID: 71106
User updated by: david dot bruchmann at gmail dot com
Reported by: david dot bruchmann at gmail dot com
Summary: Unclear explanation of cookie-domain
Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Assigned To: tpunt
Block user comment: N
Private report: N
New Comment:
Yes the new explanation is better.
I see 2 problems with the item in general, these are special cases, so they never belong in a short
explanation like here.
1) the domaine www.domain.com often is mapped to domain.com (or contrary) So www as subdomain is a
special case.
2) cookies on the domain domain.com are not available in safari-browser but only the subdomains of
it.
Previous Comments:
------------------------------------------------------------------------
[2015-12-18 18:53:47] tpunt@php.net
I'm not really keen on the the term "main-domain" you've used, and your
description could probably be shortened too.
Here's my attempt to rephrase the description: https://svn.php.net/viewvc?view=revision&revision=338304
Please let me know if something is not clear in it.
------------------------------------------------------------------------
[2015-12-18 18:50:17] tpunt@php.net
Automatic comment from SVN on behalf of tpunt
Revision: http://svn.php.net/viewvc/?view=revision&revision=338304
Log: Fix doc bug #71106
------------------------------------------------------------------------
[2015-12-12 19:34:57] david dot bruchmann at gmail dot com
Description:
------------
The current documentation of cookie-domain on the page function.setcookie.php:
"
domain
The domain that the cookie is available to. Setting the domain to 'www.example.com' will
make the cookie available in the www subdomain and higher subdomains. Cookies available to a lower
domain, such as 'example.com' will be available to higher subdomains, such as
'www.example.com'. Older browsers still implementing the deprecated » RFC 2109 may
require a leading . to match all subdomains.
"
This is unclear, the words higher and lower are used wrong or at least confusing and the explanation
never helps much in practical usage.
I propose the following text:
"
domain
The cookie-domain can be set to widen the default restriction to the current domain. The main-domain
and all sub-domains are covered if the cookie-domain is set to the main-domain such as
'example.com'. If the cookie-domain is set to a sub-domain such as
'sub1.example.com' then this and all sub-domains of 'sub1.example.com' are
covered, i.e. 'sub2.sub1.example.com'.
Using the cookie-domain can be done from any of the covered domains and cookies are available on all
these domains then. Setting the cookie-domain from a domain that is not covered by the defined
domain is not possible.
Older browsers still implementing the deprecated » RFC 2109 may require a leading . to match all
subdomains.
"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71106&edit=1