Session library fails to load |
[eluser]cybiko123[/eluser]
Hi, I've tried the standard CodeIgniter session library and the native session library, both to no avail. In both cases, I get: Message: Undefined property: Login::$session I've tried autoloading the library and loading it explicitly ($this->load->library('session')), and neither work. Am I doing something wrong?
[eluser]bobbob[/eluser]
I think you might not be using Codeigniter's session library correctly. like: Code: $this->session->set_userdata('some_data');//set it http://ellislab.com/codeigniter/user-gui...sions.html
[eluser]cybiko123[/eluser]
I looked at the user guide again, and came back with two versions: Code: $this->session->set_userdata('some_name', 'some_value'); and Code: $newdata = array( I tried both versions (copy/pasted directly from the user guide) and got the same error.
[eluser]cybiko123[/eluser]
Sure: Code: <?php
[eluser]bobbob[/eluser]
try changing this $results = $query->result(); to $results = $query->row(); and $results[0]->password; to $results->password;
[eluser]bobbob[/eluser]
I see the database is commented out. Is it auto-loading?
[eluser]cybiko123[/eluser]
It was at one point. Good catch. Unfortunately, that didn't change the error. I tried print_r()ing the array that was being passed to set_userdata, and it seems to contain the data I want to pass to set_userdata().
[eluser]bobbob[/eluser]
ok this should be it: in the controller you need this function: function Login() { parent::Controller(); } |
Welcome Guest, Not a member yet? Register Sign In |