[eluser]ThiagoPHX[/eluser]
[quote author="Dam1an" date="1250034642"]You'd need to get the array as a var from the session, add the item to the array and then put it back
Here is a simplified example from a project I'm currently working on
Code:
$recent_hotels = $this->session->userdata('recent_hotels');
if($recent_hotels == false) {
$recent_hotels = array($hotel_id);
} else {
$recent_hotels[] = $hotel_id;
}
$this->session->set_userdata('recent_hotels', $recent_hotels);
If fetching the array from the session returns false, that key doesn;t exists, so we create the array, otherwise, just add to it, and then write it back to the session[/quote]
Thanks !!!
Is exactly what i need.