note 99794 modified in function.session-regenerate-id by danbrown
| From: | danbrown@php.net | Date: | Tue, 07 Sep 2010 14:44:32 +0000 |
| Subject: | note 99794 modified in function.session-regenerate-id by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172359@lists.php.net to get a copy of this message | ||
In my code this function resulted in some Internet Explorer 8 browsers loosing their connection with
the session. As mentioned above this is probably because the page reloads before the cookie is
updated on the client side:
This is the only manual workaround that never produced this problem for me:
<?php
$old_session = $_SESSION;
session_write_close();
session_id(sha1(mt_rand()));
session_start();
$_SESSION = $old_session;
?>
--was--
In my code this function resulted in some Internet Explorer 8 browsers loosing their connection with
the session. As mentioned above this is probably because the page reloads before the cookie is
updated on the client side:
This is the only manual workaround that never produced this problem for me:
<?php
$old_session = $_SESSION;
session_write_close();
session_id(sha1(mt_rand()));
session_start();
$_SESSION = $old_session;
?>
Here is an article about it:
http://anvilstudios.co.za/blog/php/session-cookies-faulty-in-ie8/
http://php.net/manual/en/function.session-regenerate-id.php