note 29869 deleted from function.unset by sniper

From: Date: Mon, 13 Oct 2003 02:28:46 +0000
Subject: note 29869 deleted from function.unset by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-58487@lists.php.net to get a copy of this message
Note Submitter: pvlasenko@hotmail.com ---- After struggling for an hour trying to re-assign session values on the same page I have found a solution. The folowing code is used in a signup form and allows users to move back and forth between pages modify information and save it to a session. $user_info = array( 'user' => $user, 'pass' => $passwd1,); // Get the new session session_start(); // Destroy session if exsists unset($_SESSION['user_info']); // Set session to expire on clients machine setcookie(session_name(), "", time() - 3600); // Assign array back to session $_SESSION['user_info'] = $user_info;

« previous php.notes (#58487) next »