RE: [PHP] sessions
| From: | Johnson, Kirk | Date: | Tue, 21 Aug 2001 20:01:25 +0000 |
| Subject: | RE: [PHP] sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-63761@lists.php.net to get a copy of this message | ||
> session_start();
> session_unregister(val_1);
> session_register(val_1);
>
> I am doing this to clear the contents of val_1 before I use it again.
> Needless to say its not working. val_1 always contains the
> same value until
session_registering()'ing a variable just puts it in a list of names of the
session variables. session_unregister() just removes the name from the list.
Neither function affects the variable's value.
To clear the variable's value, just assign it to blank, or call unset() on
it, e.g.,
$val_1 = "";
unset($val_1);
There is no need, or use, in unregistering it, then registering it again.
Kirk