php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35810 setcookie not replacing variables
Submitted: 2005-12-27 01:20 UTC Modified: 2005-12-27 01:38 UTC
From: tkojima at able dot org Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.1.1 OS: LINUX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tkojima at able dot org
New email:
PHP Version: OS:

 

 [2005-12-27 01:20 UTC] tkojima at able dot org
Description:
------------
Set cookie does not replace variables inside name.

Reproduce code:
---------------
<?php 

$variable = "1"
setcookie('dynamic_{$variable}',true,time()+60*60*24*3);

?>


Expected result:
----------------
the cookie to be named "dynamic_1" instead of 
"dynamic_{$variable}"

Actual result:
--------------
the cookie was set as "dynamic_{$variable}"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-12-27 01:30 UTC] tony2001@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

RTFM about the difference between double and single quotes.
 [2005-12-27 01:38 UTC] tkojima at able dot org
"RTFM" is not a professional way to reply to something like this.

It stands for Read the F*#(ing Manual, or at least implies that. I don't know if you meant it that way or not, but that's how it came across.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 02:00:01 2026 UTC