Bug #71521 [Opn]: session_start floods header with Set-Cookie when called multiple times
| From: | laruence@php.net | Date: | Tue, 09 Feb 2016 13:40:53 +0000 |
| Subject: | Bug #71521 [Opn]: session_start floods header with Set-Cookie when called multiple times | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199132@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71521&edit=1
ID: 71521
Updated by: laruence@php.net
Reported by: David dot Gausmann at measX dot com
Summary: session_start floods header with Set-Cookie when
called multiple times
Status: Open
Type: Bug
Package: Session related
Operating System: Windows
PHP Version: 7.0.3
Block user comment: N
Private report: N
New Comment:
I can not reproduce this... only one cookie header is sent in my box. (php-cgi)
Previous Comments:
------------------------------------------------------------------------
[2016-02-04 16:07:29] David dot Gausmann at measX dot com
Description:
------------
In a productive website of a customer I need to start/stop the session multiple times during the
execution of a single PHP script.
In some cases the proxy server had thrown HTTP error 502 that the header is too long.
I've found out, that session_start always adds a Set-Cookie header, regardless of the fact that
there is already exactly the same header line.
This bug has already been reported here, but is still unfixed, so I create a new bug report:
https://bugs.php.net/bug.php?id=38104
https://bugs.php.net/bug.php?id=31455
Test script:
---------------
<?php
session_name('Test');
session_cache_expire(180);
session_set_cookie_params(0, '/', '', false, true);
for($i = 0; $i < 10000; ++$i)
{
session_start();
session_write_close();
}
?>
Expected result:
----------------
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
(exactly one time)
Actual result:
--------------
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
Set-Cookie: Test=68nh86r3ks6jo6tughb7d3u7a5; path=/; HttpOnly
...
(10000 times)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71521&edit=1