This is a discussion on clearing out all $_SESSOIN variables? within the PHP Language forums, part of the PHP Programming Forums category; Hello, In a particular session, I set a bunch of $_SESSION vars. Is there any way of erasing/purging all ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
In a particular session, I set a bunch of $_SESSION vars. Is there any way of erasing/purging all of them in one fell swoop or must I iterate through each one or even list them out ... $_SESSION["a"] = ""; $_SESSION["b"] = ""; ..... etc. I'm using PHP 4. Thanks for your help, - Dave |
|
|||
|
D. Alvarado wrote:
> Hello, > In a particular session, I set a bunch of $_SESSION vars. Is > there any way of erasing/purging all of them in one fell swoop or must > I iterate through each one or even list them out ... > > $_SESSION["a"] = ""; > $_SESSION["b"] = ""; > > .... etc. > > I'm using PHP 4. Thanks for your help, - Dave $_SESSION = Array (); HTH Pjotr |
|
|||
|
Pjotr Wedersteers wrote:
> D. Alvarado wrote: >> Hello, >> In a particular session, I set a bunch of $_SESSION vars. Is >> there any way of erasing/purging all of them in one fell swoop or >> must I iterate through each one or even list them out ... >> >> $_SESSION["a"] = ""; >> $_SESSION["b"] = ""; >> >> .... etc. >> >> I'm using PHP 4. Thanks for your help, - Dave > > $_SESSION = Array (); > HTH > Pjotr Forgot: or use Session_unset () |
|
|||
|
"Pjotr Wedersteers" <pjotr@wedersteers.com> wrote in news:417a0a8d$0
$78749$e4fe514c@news.xs4all.nl: > Pjotr Wedersteers wrote: >> D. Alvarado wrote: >>> Hello, >>> In a particular session, I set a bunch of $_SESSION vars. Is >>> there any way of erasing/purging all of them in one fell swoop or >>> must I iterate through each one or even list them out ... >>> >>> $_SESSION["a"] = ""; >>> $_SESSION["b"] = ""; >>> >>> .... etc. >>> >>> I'm using PHP 4. Thanks for your help, - Dave >> >> $_SESSION = Array (); >> HTH >> Pjotr > > Forgot: or use Session_unset () > > > or use both? I think the manual uses that as an example. |