I have created a login system in codeigniter project, which is working fine in Firefox but doesn\'t work in Chrome, data fetch and set for session but when this code redirec
just to add my experience, I'm using Codeigniter 2.1.4,
Issue: sessions on Chrome didn't last more than a couple minutes, or get logged out while doing ajax requests. I tried several approachs: (changed sess_cookie_name, longer sess_expiration time).
I just found that setting sess_encrypt_cookie to FALSE fixed the chrome logout issue.
$config['sess_encrypt_cookie'] = FALSE;
Not sure why, maybe cookie length issue on chrome (as far as I know encryption increases a lot a string length).
I know encrypting adds an extra level of security, but as far as I've read, the data stored in the cookie is not sensitive.
Hope it helps!
perfect answer by Shayan Husaini I had the same problem and i resolved it by changing
$config['sess_expiration'] = 8600;
which is seconds in 24 hours, it was seconds in 2 hours
$config['sess_expiration'] = 7200;
I live in Pakistan and using server of USA so this problem pop up.
Thanks Shayan it was great help.
I had the same problem and I could solve the problem by changing value of $config['sess_time_to_update'] = 3;
in /application/config/config.php of CodeIgniter framework.
I changed the sess_match_useragent param to false in the config.php
$config['sess_match_useragent'] = FALSE;
And the problem with google chrome was resolved.
Solved, CodeIgniter has some problem if the specified domain for cookies is localhost, I've set a fake domain with a real domain's name structure into the hosts file and it works.
Check your server php version if its 7.x change to 5.6 it works for me