Re: [PHP] deleting session variables

2003-08-19 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]>

> So what does session_unset() do then?

Ah, good catch. Use that instead of my second example. If register_globals
is ON, it appears that session_unset() will take care of getting rid of the
global variables made.

---John Holmes...

> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: August 19, 2003 5:11 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] deleting session variables
>
> From: "Tim Winters" <[EMAIL PROTECTED]>
> > Is there a way to wipe out all previous session variables with one
> > command?
>
> With register_globals OFF:
>
> $_SESSION = array();
>
> If register_globals is ON and you want to get rid of $val1, $val2,
> $val3,
> etc... then:
>
> foreach($_SESSION as $key => $value)
> { unset($$key); }
>
> ---John Holmes...
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] deleting session variables

2003-08-19 Thread Curt Zirzow
* Thus wrote Tim Winters ([EMAIL PROTECTED]):
> Thanks,
> 
> So what does session_unset() do then?

John overlooked that function, and instead looped through the
variables in php instead.  This would be used if you have
register_globals on and choose to use sessions insecurely.

> 
> -Original Message-
> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
> Sent: August 19, 2003 5:11 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] deleting session variables
> 
> 
> If register_globals is ON and you want to get rid of $val1, $val2,
> $val3,
> etc... then:
> 
> foreach($_SESSION as $key => $value)
> { unset($$key); }
> 

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] deleting session variables

2003-08-19 Thread Tim Winters
Thanks,

So what does session_unset() do then?

Tim Winters
Creative Development Manager
Sampling Technologies Incorporated

1600 Bedford Highway, Suite 212
Bedford, Nova Scotia
B4A 1E8
www.samplingtechnologies.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Office: 902 450 5500
Cell: 902 430 8498
Fax:: 902 484 7115


-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: August 19, 2003 5:11 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] deleting session variables

From: "Tim Winters" <[EMAIL PROTECTED]>
> Is there a way to wipe out all previous session variables with one
> command?

With register_globals OFF:

$_SESSION = array();

If register_globals is ON and you want to get rid of $val1, $val2,
$val3,
etc... then:

foreach($_SESSION as $key => $value)
{ unset($$key); }

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] deleting session variables

2003-08-19 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]>
> Is there a way to wipe out all previous session variables with one
> command?

With register_globals OFF:

$_SESSION = array();

If register_globals is ON and you want to get rid of $val1, $val2, $val3,
etc... then:

foreach($_SESSION as $key => $value)
{ unset($$key); }

---John Holmes...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] deleting session variables

2003-08-19 Thread Tim Winters
Is there a way to wipe out all previous session variables with one
command?
 
Thx
 
Tim Winters
Creative Development Manager
Sampling Technologies Incorporated
 
1600 Bedford Highway, Suite 212
Bedford, Nova Scotia
B4A 1E8
www.samplingtechnologies.com
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Office: 902 450 5500
Cell: 902 430 8498
Fax:: 902 484 7115