note 83452 added to function.session-regenerate-id

From: Date: Tue, 27 May 2008 06:09:12 +0000
Subject: note 83452 added to function.session-regenerate-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-139835@lists.php.net to get a copy of this message
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 ---- Server IP: 203.199.69.133 Probable Submitter: 59.93.194.200 ---- Manual Page -- http://www.php.net/manual/en/function.session-regenerate-id.php Edit -- https://master.php.net/note/edit/83452 Del: integrated -- https://master.php.net/note/delete/83452/integrated Del: useless -- https://master.php.net/note/delete/83452/useless Del: bad code -- https://master.php.net/note/delete/83452/bad+code Del: spam -- https://master.php.net/note/delete/83452/spam Del: non-english -- https://master.php.net/note/delete/83452/non-english Del: in docs -- https://master.php.net/note/delete/83452/in+docs Del: other reasons-- https://master.php.net/note/delete/83452 Reject -- https://master.php.net/note/reject/83452 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139835) next »