I have checked the result but unable to solve my error.
I have simply used session_start and it gives this warning message.
ini_set(): A session is active. You cannot change the session module's ini settings at this time
Below is my code -
$sess_array = array(
'id' => $row->empid,
'username' => $row->emp_name,
'loggedIn' => '1',
'usertype' => $usertype
);
$this->session->set_userdata('logged_in', $sess_array); // store session
Dashboard.php page-
session_start();
error_reporting(E_ALL & ~E_NOTICE);
//error_reporting(0);
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Dashboard extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
if ($this->session->userdata('logged_in'))
{
$EmpName = $this->session->userdata['logged_in']['username'];
$Emp_id = $this->session->userdata['logged_in']['id'];
}
}
Although the same question has asked but i didnt get the proper solution for this question. Please anyone solve that query.
session_start();
fromdashboard.php
. Codeignitor itself started session when project initiated through URL. (through configuration files) – Anant Kumar Singhelse
part in that code – brombeer