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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 - 11 = ?
Subscribe to this entry?

 
 [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: Sat Jun 01 09:01:31 2024 UTC