[eluser]Phil Sturgeon[/eluser]
[quote author="bigtony" date="1257259394"]Change this:
Code:
// change this
$this->session->set_userdata(array('arrShopItem' => $arrAddItem));
// To this:
$this->session->set_userdata('arrShopItem', $arrAddItem);
Then read it back like this:
Code:
$arrAddItem = $this->session->userdata('arrAddItem');
[/quote]
That doesn't cover it entirely.
Code:
$arrShopItems = $this->session->userdata('arrShopItem');
$arrAddItem = array();
// populate the array with your data
$arrShopItems[] =& $arrAddItem;
$this->session->set_userdata('arrShopItem', $arrShopItems);
It's basically saying, get all the current items, add the new one, remember all of the items.
It's a bit of extra work, but dealing directly with Super-globals can lead to bad mojo.