note 83452 deleted from function.session-regenerate-id by felipe

From: Date: Tue, 27 May 2008 11:29:52 +0000
Subject: note 83452 deleted from function.session-regenerate-id by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-139846@lists.php.net to get a copy of this message
Note Submitter: anub_india at yahoo dot com ---- i want to regenerate the session id after storing something in a session variable due to security perspective. my php version is 4.3.2. so i am doing the following page1.php <?php include("sessionHandler.php"); ini_set('session.gc_maxlifetime', 1800); ini_set('session.cookie_lifetime', 1800); session_start(); // Start the session at the top of the file session_register('token'); $tkn = md5(uniqid(rand(),TRUE)); $_SESSION['token'] = $tkn; session_destroy(); session_start(); $old_data = $_SESSION; // back up the data ?> page2.php <?php include("sessionHandler.php"); ini_set('session.gc_maxlifetime', 1800); ini_set('session.cookie_lifetime', 1800); session_start(); var_dump($_SESSION); //but not getting in page2 but this value is not passing to the next page(page2). i am using the set _session_handler and saving it to the database. how i can regenearte the id with out lossing the data. when i use the regenerate_id function it is generating the new session id but the same problem is there. how can i implement this in php 4.3.2

« previous php.notes (#139846) next »