Doc #66725 [Com]: Clarification required as to what happens if domain argument isn't passed

From: Date: Mon, 24 Feb 2014 22:42:36 +0000
Subject: Doc #66725 [Com]: Clarification required as to what happens if domain argument isn't passed
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-11014@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66725&edit=1 ID: 66725 Comment by: chrispmaiden at gmail dot com Reported by: jarrod at makin dot co Summary: Clarification required as to what happens if domain argument isn't passed Status: Open Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Having looked at the source code setcookie() doesn't appear to set the domain unless one is passed to the function, this can be tested by executing this simple script: <?php setcookie('testing', '123', time()+60*60*24*30, '/'); print_r(headers_list()); Outputs: Array ( [0] => X-Powered-By: PHP/5.4.21 [1] => Set-Cookie: testing=123; expires=Wed, 26-Mar-2014 22:27:59 GMT; path=/ ) The argument is optional, it's in square brackets so for me I think the documentation is fine (just my opinion though!) Previous Comments: ------------------------------------------------------------------------ [2014-02-17 00:54:43] jarrod at makin dot co Description: ------------ --- From manual page: http://www.php.net/function.setcookie --- Clarification is desired to make it clear to me what happens if the domain argument is not passed to this function. If I set session.cookie_domain in a php.ini file, will it come into play? If I leave it blank, will php use a variable like $_SERVER["SERVER_NAME"]? ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66725&edit=1

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