![]() |
CI Session being destroyed - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: CodeIgniter 2.x (https://forum.codeigniter.com/forumdisplay.php?fid=18) +--- Thread: CI Session being destroyed (/showthread.php?tid=61775) |
CI Session being destroyed - dwlamb - 05-15-2015 I am using CI for a login and session management on a site. For some reason only on the production server, not the development stack, the session data is being altered. These are abridged versions of my code: PHP Code: <?php To debug what is happening, I used the following at the above mentioned points in my code: PHP Code: $array = $this->session->all_userdata(); At the end of login the session user data is as it should be: Code: userdata at user->login However that is not the session data returned at display->index: Code: Array Code: $config['sess_cookie_name'] = 'ci_session'; An encryption key is set even though I am not opting to encrypt the cookie. The mcrypt extension is installed and functioning on the server. I am really baffled by this and hope someone can provide what to do. RE: CI Session being destroyed - dwlamb - 05-16-2015 This problem is solved. After further research I found a very good article for abandoning CodeIgniter session in favour of PHP sessions using a simple library: https://www.moreofless.co.uk/using-native-php-sessions-with-codeigniter/ RE: CI Session being destroyed - CroNiX - 05-16-2015 It looks like you are storing your session data in a cookie, which is not very good since users can alter cookie data from within their browser, especially when you're not encrypting the cookie! Cookies have a limit on how much data they can store (2k). Is it possible you're trying to store too much data? Are you using ajax much? |