Welcome Guest, Not a member yet? Register   Sign In
Why session do not !!!
#1

[eluser]Unknown[/eluser]
Hi !!!

- code Structure is following:
---> Master page: main.php (extends Controller)
---> Controllers: controllers/[folder_name]/[controller_name].php (extends Controller)

---> Note: [...]: can be change

- Idea for these do !!!: all request from client will be access directly to Master page (main.php). Master page will be choice controller and method of it (I write MLoader.php class for load controllers).

- Problem: inside Master page i can call $this->session->userdata('session_name');. It do well. But i can not call $this->session->userdata('session_name'); insite Controllers.

Error:
Fatal error: Call to a member function set_userdata() on a non-object in C:\xampp\htdocs\revnicts\system\admin\controllers\account\account.php on line 17

This is account controller code:
<?php
class Account extends Controller {

--------function Account() {
----------------parent::Controller();
--------}

--------function index() {
----------------return '';
--------}

--------function login() {
----------------$session_data = array( 'admin_id' => 1,
----------------------------------------'logged_in' => TRUE
----------------------------------------);

----------------$this->session->set_userdata($session_data);

----------------return 'login box';
--------}
}
?>

Please tell me the way fix this problem

Thanks,


Messages In This Thread
Why session do not !!! - by El Forum - 09-12-2007, 06:14 PM
Why session do not !!! - by El Forum - 09-12-2007, 07:35 PM
Why session do not !!! - by El Forum - 09-13-2007, 07:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB