Re: Multiple sessions open at same time, is it possible? [ Solved, thankyou !]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2 Mar 2008, at 16:32, Richard wrote:
Stut a écrit :
Just curious... why are you setting the password to an empty array? You'd probably be better off unset'ing it so you can use isset to check for it.

Oh right ! :)
Yes you're right about the array, I used it by mistake, as to reset a value in $_SESSION[cart] , ie : $_SESSION['cart']['item_number'] I had to do $_SESSION['cart']['item_number'] = array(); as unset would anly work for unsetting the whole cart and not just one item, but yes it would be best to use unset for $_SESSION['password'] !

Eh? What's in $_SESSION['cart']['item_number']? You might want to consider one of the following depending on what's in that array element...

unset($_SESSION['cart']['item_number']);

unset($_SESSION['cart'][array_search($itemtoremove, $_SESSION['cart'])]);

unset($_SESSION['cart']['item_number'][array_search($itemtoremove, $_SESSION['cart']['item_number'])]);

At the very least it would be better to use null rather than array(), but actually removing the item from the array would be my recommendation.

-Stut

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux