[eluser]brainer[/eluser]
Solved it.... finally!
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session
{
/**
* Add or change data in the "userdata" array
*
* @access public
* @param mixed
* @param string
* @param bool if set to true we will grab the session data from database again
* @return void
*/
function set_userdata($newdata = array(), $newval = '', $get_again = false)
{
if($get_again) $this->sess_read(); // just in case the session has been updated elsewhere after the Session library was loaded here
if (is_string($newdata))
{
$newdata = array($newdata => $newval);
}
if (count($newdata) > 0)
{
foreach ($newdata as $key => $val)
{
$this->userdata[$key] = $val;
}
}
$this->sess_write();
}
}
/* End of file MY_Session.php */
/* Location: ./application/libraries/MY_Session.php */
So, I added a third param $get_again, which if set to true will make sure that the session library has the most up to date session info.
Hope this is of some use to someone...