So I have a controller in codeigniter, I wish to include a session that I have started within the same website but different folder (non codeigniter)
the session I would normal use like so
session_start();
$userID = $_SESSION[userid];
now I can use
$userID
var anywhere within that page.
how ever I am new to codeigniter and for what I have seen I need to include session in autoload, I have done this.
Then
$session_id = $this->session->userdata('userid');
What I have tried:
private function getResults()
{
{
$data['emailcount'] = $score = $this->actions->getEmailCount();
$data['sentEmailCount'] = $score = $this->actions->getSentEmailCount();
$data['score'] = $score = $this->actions->getScore();
$data['percentile'] = $percentile = $this->actions->getPercentile($score);
$data['timespent'] = $this->input->get('time');
};
$adddata = array(
'uniID' => '5',
'testName' => 'Abintegro E-Tray test',
'testID' => '99999',
'total' => '20',
'userID' => '00000',
'useInPercentile' => '1',
'correct' => $score = $this->actions->getScore(),
'percent' => $score = $this->actions->getScore(),
'percentile' => $percentile = $this->actions->getPercentile($score),
'dateTaken' => date('Y-m-d H:i:s'),
'timeSpent' => $this->input->get('time'),
'userID' => $session_id = $this->session->userdata('userid');
);
$this->actions->add_record($adddata);
return $this->load->view('client/results', $data);
}