note 81338 deleted from ref.session by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 16:33:44 +0000 |
| Subject: | note 81338 deleted from ref.session by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142182@lists.php.net to get a copy of this message | ||
Note Submitter: anonymousleaf at gmail dot com
----
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!
?>