Bug #66469 [NEW]: PHP creates two session ids when using strict mode

From: Date: Sun, 12 Jan 2014 08:28:12 +0000
Subject: Bug #66469 [NEW]: PHP creates two session ids when using strict mode
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183728@lists.php.net to get a copy of this message
From:             oz at zend dot com
Operating system: All
PHP version:      5.5.8
Package:          Session related
Bug Type:         Bug
Bug description:PHP creates two session ids when using strict mode

Description:
------------
When you enable the strict mode and then you execute session_start()
without supplying a PHPSESSID (using php-cgi, cli, or ApacheBench for
example), PHP creates two session ids and returns two SetCookie headers
with both session ids.

I believe the second session id can be avoided since PHP knows it just
created the session id for the first time.

Test script:
---------------
<?php
ini_set("session.use_strict_mode", "1");
ini_set("session.save_handler", "files");
session_start();
?>


Expected result:
----------------
"
Set-Cookie: PHPSESSID=k6brqpp9rnh2ajo2tch4l68t84; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-type: text/html
"


Actual result:
--------------
"
Set-Cookie: PHPSESSID=k1hn6r22om8kiq60nq72hhsa52; path=/
Set-Cookie: PHPSESSID=k6brqpp9rnh2ajo2tch4l68t84; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Content-type: text/html
"


-- 
Edit bug report at https://bugs.php.net/bug.php?id=66469&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=66469&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=66469&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=66469&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=66469&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=66469&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=66469&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=66469&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=66469&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=66469&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=66469&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=66469&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=66469&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=66469&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66469&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=66469&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=66469&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=66469&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66469&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=66469&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=66469&r=mysqlcfg



Thread (7 messages)

« previous php.bugs (#183728) next »