[eluser]Solarpitch[/eluser]
This is my first time using sessions in CI and I'm not sure whats happening. In another part of my application I'm assigning sessions as follows...
Code:
$this->session->set_userdata('13:00:00', 6)
$this->session->set_userdata('14:00:00', 26)
$this->session->set_userdata('15:00:00', 17)
The problem is when I try to call them in the showsummery chart below, they wont echo the value. I have echoed the sessions in another page and they print their respective values.
Code:
function showsummary()
{
$this->load->helper('graph');
$this->load->library('session');
//Strange thing is... if I was to set the session here, it would work fine...
$this->session->set_userdata('14:00:00', 26);
$chart =
"
<chart>
<chart_border color='000000' top_thickness='1' bottom_thickness='2' left_thickness='0' right_thickness='0' />
<chart_data>
<row>
<null/>
<string>6am</string>
<string>7</string>
<string>8</string>
<row>
<string>Region A</string>
//These will not print their values unless the sesion was set in this function like above
<number>".$this->session->userdata('14:00:00')."</number>
<number>".$this->session->userdata('15:00:00')."</number>
<number>".$this->session->userdata('16:00:00')."</number>
......
</chart>
";
SendChartData ($chart);
}
Is there something I'm missing here?