Session variable not working in other controller |
03-11-2017, 11:42 PM
(This post was last modified: 03-14-2017, 03:21 AM by himelali. Edit Reason: More content for describ )
I set a session variable in my login controller after successful login. When I check for the variable in my dashboard controller no session data is found.
When I check the session in the login controller, session data exists. It does not exist when I check the dashboard controller. I have also tried using database sessions but same problem occur here. I am using CodeIgniter 3.1.3 with HMVC (Module Based MX Controller) and use some other library PHPMailer DomPDF (Both are loaded by autoload.php). Both library are work fine. I have checked in Database, Many times I have found 2 different session ID generated in other controller in the same time after 5 min it has been changed. When my computer has restarted or cookie deleted, then works fine, after sometime this problem has occur. I have checked session with $_SESSION, $this->sesssion->all_userdata(), $this->session->userdata; both output are different in different controller. I have load session library in autoload.php created and updated by composer. My Config File for Session ================ $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = APPPATH . 'cache/'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; |
Welcome Guest, Not a member yet? Register Sign In |