Re: session variables

From: Date: Wed, 18 Dec 2002 15:25:52 +0000
Subject: Re: session variables
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-128723@lists.php.net to get a copy of this message
Justin French wrote:
1. the opposite of session_register('varname') is session_unregister('varname') NOT unset($varname) 2. Are you on PHP >= 4.1 ?? If so, move away from things like: <? session_start(); $variable = 'foo'; session_register('variable'); session_unregister('variable') ?> and into: <? session_start(); $_SESSION['variable'] = 'foo'; $_SESSION['variable'] = 'bah'; unset($_SESSION['variable']); ?> MUCH cleaner to work with :) Justin on 17/12/02 10:35 PM, Antti (antti@victoria.fi) wrote:
How can I change the values of session variables (session_register('variable');) in a session. Do I just unset($variable); and do session_register() again and give it a new value. I tried this and it seems that it doesn't work. Antti
Justin French -------------------- http://Indent.com.au Web Development & Graphic Design -------------------- Neather this seem to work
$_SESSION['some_variable']=$variable; nor this: $_SESSION['today']= date('Y-m-d h:m:s'); antti

« previous php.general (#128723) next »