#48243 [Bgs]: Cookie not set after setting cookie in .htaccess
| From: | stephan dot schulze at kapthon dot com | Date: | Wed, 13 May 2009 06:27:07 +0000 |
| Subject: | #48243 [Bgs]: Cookie not set after setting cookie in .htaccess | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137239@lists.php.net to get a copy of this message | ||
ID: 48243
User updated by: stephan dot schulze at kapthon dot com
Reported By: stephan dot schulze at kapthon dot com
Status: Bogus
Bug Type: HTTP related
Operating System: Centos 5.3
PHP Version: 5.2.9
New Comment:
I do not want to reset a cookie but to set another second or third
cookie.
PHP even doesn't set a session cookie, when a cookie is set via
htaccess before.
So the problem is:
after setting a cookie via htaccess, PHP doesn't set any other cookies
anymore
I do not know whether this is really a bogus bug.
Previous Comments:
------------------------------------------------------------------------
[2009-05-13 00:56:13] jani@php.net
I would guess you need to match all the parameters used to be able to
reset a cookie. But you're better of using header() with the replace
parameter set to true.
------------------------------------------------------------------------
[2009-05-12 07:50:28] stephan dot schulze at kapthon dot com
Description:
------------
setcookie does not set a cookie when a cookie is set in .htaccess file
first
I do not know whether this is a bug or expected behaviour
Reproduce code:
---------------
.htaccess Code
==============
<FilesMatch "\.(html|htm|xml|txt|php)$">
SetEnvIf Cookie "^.*testcookie.*$" cookie_set=1
Header set Set-Cookie: "testcookie=1; path=/;" env=!cookie_set
</FilesMatch>
Cookie is set here
PHP-Code
========
setcookie('testphp', 'test_' . time());
in index.php => cookie is not set
Expected result:
----------------
"testcookie" AND "testphp"-Cookie should be set
Actual result:
--------------
Only "testcookie" is set,any calls to setcookie does not set any cookie
at all
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48243&edit=1