Doc #71106 [Asn]: Unclear explanation of cookie-domain

From: Date: Fri, 18 Dec 2015 18:53:49 +0000
Subject: Doc #71106 [Asn]: Unclear explanation of cookie-domain
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12967@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
 Updated by:         tpunt@php.net
 Reported by:        david dot bruchmann at gmail dot com
 Summary:            Unclear explanation of cookie-domain
 Status:             Assigned
 Type:               Documentation Problem
 Package:            Documentation problem
 PHP Version:        Irrelevant
 Assigned To:        tpunt
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.doc.bugs (#12967) next »