Click to See Complete Forum and Search --> : storing multiple values in session variables


damon2003
12-04-2003, 08:03 AM
Hi,
The user goes to a page and variables are added to sessions. Then the user goes back and then continues to a page where I need more variable to be added to the same session variables. In other words I want the session variables to act as arrays, so that values can keep being added to the same named session variable, and then to be able to pul them out one by one. Can this be done?
thanks

Khalid Ali
12-04-2003, 08:20 PM
php session is an array of objects.What you can do is set as many variables as you want in session like this

$_SESSION['var_1'] = "Some Value";
$_SESSION['var_2'] = "Some Value";
$_SESSION['var_3'] = "Some Value";

pyro
12-04-2003, 08:25 PM
See also, http://us4.php.net/manual/en/function.serialize.php.