whenever i add $this->load->library('session'); property in code igniter function the session will destroy automatically ..
please help me about this..
controller function:
public function logged()
{
$this->load->library('session');
$this->load->view('includes/header');
$this->load->view('includes/nav');
$this->load->view('index');
$this->load->view('includes/footer');
}
view page:
<h4><?php echo $this->session->flashdata('item'); ?></h4>
Error: A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$session
Filename: views/index.php
Line Number: 6
Backtrace:
File: C:\xampp\htdocs\ravi2\application\views\index.php Line: 6 Function: _error_handler
File: C:\xampp\htdocs\ravi2\application\controllers\welcome.php Line: 19 Function: view
File: C:\xampp\htdocs\ravi2\index.php Line: 315 Function: require_once
$this->load->library('session');add this in constructor - devpro