php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65830 important information on setcookie is missing
Submitted: 2013-10-04 14:17 UTC Modified: 2013-10-04 16:37 UTC
From: mash at sha-mash dot de Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.5.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mash at sha-mash dot de
New email:
PHP Version: OS:

 

 [2013-10-04 14:17 UTC] mash at sha-mash dot de
Description:
------------
---
From manual page: http://www.php.net/function.setcookie
---
I have been searching for an hour why my cookie was not set by

setcookie('user',$value,time()+3600,'/',$SITENAME,0,0);
where $SITENAME equals 'www.qmd.test/'

until I figured out that the trailing slash prevents the cookie from being set.
Maybe this would be helpful to insert into the documentation part of this parameter (domain).

Keep up the good work and Thanks for your work
-m*sh-


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-04 15:00 UTC] gabri dot ns at gmail dot com
the documentation already, clearly, tell you to use domain name.
even an example is provided, and it is not containing trailing slash.

try execute this line to more understanding which part is which
from an URL

print_r(parse_url("http://gabri:1234@google.com:80/my/document.html"));
 [2013-10-04 16:37 UTC] krakjoe@php.net
-Status: Open +Status: Not a bug
 [2013-10-04 16:37 UTC] krakjoe@php.net
This is a programming error: a domain cannot include a slash.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 02:01:32 2024 UTC