From:             m dot v dot veluw dot smscity at gmail dot com
Operating system: any
PHP version:      5.1.4
PHP Bug Type:     Session related
Bug description:  session_start()/session_write_close() creates multiple 
session cookies headers

Description:
------------
When using session_start() and session_write_close() with the same session
id/name will add multiple session cookies with the exact same contents
everytime session_start is used.

This is useless overhead if it is the same.

Reproduce code:
---------------
session_name('uniqueName1');
session_start();
$_SESSION['Foo1'] = 'Bar1';
session_write_close();

session_name('uniqueName2');
session_start();
$_SESSION['Foo2'] = 'Bar2';
session_write_close();

session_name('uniqueName1');
session_start();
$sessionValue = $_SESSION['Foo1'];
print $sessionValue;
session_write_close();

session_name('uniqueName2');
session_start();
$sessionValue = $_SESSION['Foo2'];
print $sessionValue;
session_write_close();

Expected result:
----------------
just 1 session cookie header for uniqueName1.

just 1 session cookie header for uniqueName2.

Actual result:
--------------
2 session cookie headers for uniqueName1, where both are exactly the same

2 session cookie headers for uniqueName2, where both are exactly the same

-- 
Edit bug report at http://bugs.php.net/?id=38104&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=38104&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=38104&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=38104&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=38104&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=38104&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=38104&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=38104&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=38104&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=38104&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=38104&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=38104&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=38104&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=38104&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=38104&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=38104&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=38104&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=38104&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=38104&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=38104&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=38104&r=mysqlcfg

Reply via email to