CodeIgniter Forums
Undefined property: controller::$session - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Undefined property: controller::$session (/showthread.php?tid=44301)



Undefined property: controller::$session - El Forum - 08-10-2011

[eluser]8andrej8[/eluser]
Hi why do I get this error: (I DO load session library)
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: controller::$session

Filename: controllers/controller.php

Line Number: 23
this is controller
Code:
class controller extends CI_Controller {
    
    public $data;

    public function index()
    {    
       $this->load->database();  
       $this->load->model('model');
       $this->load->library( array('session', 'form_validation') );
       $this->load->helper( array('url', 'form') );
       /*LINE 23 */$this->data['flash_login'] = $this->session->flashdata('login');
       $this->load->view('index_view', $this->data);
    }



Undefined property: controller::$session - El Forum - 08-11-2011

[eluser]8andrej8[/eluser]
if I put session and form_validation loading into autoload, everything is OK
What the HECK is going on?


Undefined property: controller::$session - El Forum - 08-11-2011

[eluser]JonoB[/eluser]
You haven't actually given that a controller a name of 'controller'...have you?

http://ellislab.com/codeigniter/user-guide/general/reserved_names.html


Undefined property: controller::$session - El Forum - 08-11-2011

[eluser]8andrej8[/eluser]
thank you it seems i did.