I am trying to access some session data inside a custom controller, but can’t seem to get it to work after upgrading to the latest EE version.
Part of my setup is based on data from this post:
http://venodesigns.net/2011/05/07/when-expressionengine-defaults-are-not-enough/
class MY_CUSTOM_CLASS extends CI_Controller {
public function __construct() {
// Call the CI_Controller's Constructor
parent::__construct();
// Calls the EE & CI initialization
//$this->core->_initialize_core(); <-- Commented because this generates an error
$this->EE =& get_instance();
// Load database class + session library
$this->EE->load->database();
$this->EE->load->library('session');
}Initializing the core
$this->core->_initialize_core();causes this error
A PHP Error was encountered
Severity: Notice
Message: Undefined property: MY_CUSTOM_CLASS::$coreand loading the session library
$this->EE->load->library('session');
causes these errors
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant REQ - assumed 'REQ'
Filename: libraries/Session.php
Line Number: 1396
--
A PHP Error was encountered
Severity: Notice
Message: Use of undefined constant REQ - assumed 'REQ'
Filename: libraries/Session.php
Line Number: 1105
---
A PHP Error was encountered
Severity: Notice
Message: Undefined property: MY_CUSTOM_CLASS::$extensions
Filename: libraries/Session.php
Line Number: 137Any idea what might cause this and how to solve it?
Thanks!