note 81338 added to ref.session
| From: | anonymousleaf at gmail dot com | Date: | Sat, 23 Feb 2008 03:41:46 +0000 |
| Subject: | note 81338 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136431@lists.php.net to get a copy of this message | ||
You can secure your sessions by copying the session data and resetting the ID. The simplest way to
do this would be to reset the session, so
<?php
session_start(); // Start the session at the top of the file
$old_data = $_SESSION; // back up the data
session_destroy(); // Delete the session
session_start(); // We have another session now with a fresh ID
$_SESSION = $old_data; // Restore the session
unset($old_data); // Free space!
?>
----
Server IP: 69.147.83.197
Probable Submitter: 75.67.221.114
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- https://master.php.net/note/edit/81338
Del: integrated -- https://master.php.net/note/delete/81338/integrated
Del: useless -- https://master.php.net/note/delete/81338/useless
Del: bad code -- https://master.php.net/note/delete/81338/bad+code
Del: spam -- https://master.php.net/note/delete/81338/spam
Del: non-english -- https://master.php.net/note/delete/81338/non-english
Del: in docs -- https://master.php.net/note/delete/81338/in+docs
Del: other reasons-- https://master.php.net/note/delete/81338
Reject -- https://master.php.net/note/reject/81338
Search -- https://master.php.net/manage/user-notes.php