This is in a controller
class LandingPage extends CI_Controller {
public function startEncryptedSession(){
$this->load->library('session');
$this->load->library('encrypt');
$this->load->view('index', array('session', $this->session));
}
}
How do I load this in the view index
view
code
<?php echo $head; ?>
<body>
<?php echo $guts; ?>
</body>
<?php echo $foot; ?>
<?php echo $session->userdata('session_key'); ?>
I'm using code igniter MVC
When I load the view, it gives me:
<h4>A PHP Error was encountered</h4>
<p>Severity: Notice</p>
<p>Message: Undefined variable: session</p>
<p>Filename: views/index.php</p>
<p>Line Number: 8</p>
</div><br />
<b>Fatal error</b>: Call to a member function userdata() on a non-object