Re: Deleting session vars
| From: | Soeren Staun-Pedersen | Date: | Tue, 31 Oct 2000 10:32:34 +0000 |
| Subject: | Re: Deleting session vars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-22898@lists.php.net to get a copy of this message | ||
> I created a session var a
> and associated $a with $b = "hallo".
>
> Now, in another Site, $b has to get its new value from an input field. But
> as long as session_start() is set, $b stys hallo. I tried to clear this by
> session_unset(); with no effect.
I am not sure you're using session the right way. This is an example of
"correct" use:
page a:
session_start();
...
$foo="foobar";
$MYVAR=$foobar; //Could be just $MYVAR="foobar";
session_register("MYVAR");
...
Page b:
session_start();
$MYVAR="other value";
...
That's it!
Be sure that if you manipulate $MYVAR inside a function that you do it
like this:
function something($bla)
{
global $MYVAR;
$MYVAR=$bla;
}
etc.
Soeren Staun-Pedersen - staun@netwarriors.org
------
"The internet is full, beat it"
- Me.