CodeIgniter Forums
[solved]Is it possible to add on attributes into an existing session? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [solved]Is it possible to add on attributes into an existing session? (/showthread.php?tid=47479)



[solved]Is it possible to add on attributes into an existing session? - El Forum - 12-09-2011

[eluser]Unknown[/eluser]
I have set a session after admin has login
Code:
$data = array(
    'admin_username' => $this->input->post('admin_username'),
    'type'   => 'admin',

   );

  
   $this->session->set_userdata($data);

I would like to know if is possible to add on items once a session has been set.

for example currently in my session, I have 'admin_username' and 'type'
after this session data has set, when running a particular function that require additional information to set in the session, perhaps 'admin_username', 'type' and 'count'

Is it possible to add 'count' attribute inside an existing session?

Many thanks in advance.