I am using this code to output all the registered session variables –
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
exit();
This is what I get
Array
(
[language] => english
[navigation] => navigationHistory Object
(
[path] => Array
(
[0] => Array
(
[get] => Array
(
)
[post] => Array
(
)
)
[1] => Array
(
[get] => Array
(
)
[post] => Array
(
[cart_number] => XXXXXXXXXXXX
[x] => 62
)
)
)
)
)
I would like to update the cart_number variable in the Session Array from XXXXXXXX… to 555555. I tried
$_SESSION['navigation']->path[1]['post']['cart_number'] = 5555555
This works and all but the problem is, the cart_number variable is not always in the
[1] => Array. It can be in [2] or [3] or whatever.
So my question is, is there anyway I can may be search through the Session Array for that specific variable and update it with the right value? Thanks.
you can set it this way..
This will overwrite all cart_numbers which are set up