note 54373 deleted from function.session-write-close by nlopess
| From: | nlopess@php.net | Date: | Fri, 01 Jul 2005 18:22:01 +0000 |
| Subject: | note 54373 deleted from function.session-write-close by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-91279@lists.php.net to get a copy of this message | ||
Note Submitter: michael_php at favorsoftware dot com
----
warning: updating $_SESSION variables AFTER a session_write_close() does not work!
example:
session_start();
$_SESSION['test'] = 'bad old data';
session_write_close();
$_SESSION['test'] = 'good new data'; # changes to variable are not saved
session_write_close();
include('test2.php');
#
# test2.php
#
session_start();
print '<html><body>';
print 'test='. $_SESSION['test']; # displays 'bad old data'!
print '</body></html>';
the 'good new data' is lost.