[eluser]CroNiX[/eluser]
Well, you didn't show all your code the first time around so I didn't know about the other loop. The exact same problem exists in this loop now. You are storing the array over and over in session using the same key, product_list.
You're basically doing this in the loop.
Code:
$var['product_loop'] = 1;
$var['product_loop'] = 3;
$var['product_loop'] = 2;
What's $var['product_loop']? It's 2, the last thing you saved it as.
You want to be doing:
Code:
$var['product_loop'][] = 1;
$var['product_loop'][] = 3;
$var['product_loop'][] = 2;
Now what's the value of $var['product_loop']?
Code:
array(
[0] => 1,
[1] => 3,
[2] => 2
)
and then store the serialized array $var outside of the loop. Also define $var = array(); before you start the loop.
This has nothing to do with sessions or storing data in sessions. It's how you are storing your array values constantly overwriting the previous value instead of adding it to an array.