Solution to: My Cookies are not working in CI application
I have been experimenting this problem before, and let me ask you the following question… are you using Xampp? I have experimenting this problem in Xampp only.
If yes, then you can try the following solutions. (Although you can try the solutions whatever is your server).
The first and fast way to solve it
Go to your application/config.php file and change the session cookie name (remove the underscore).
From:
$config['sess_cookie_name'] = 'ci_session';
To:
$config['sess_cookie_name'] = 'cisession';
Doesn’t work?
Well, there are some other possible solutions you can try.
Change your application/config.php from AUTO to REQUEST_URI.
Try running your application by using 127.0.0.1 instead of localhost.
Make sure your config.php has the following settings for cookies.
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
If nothing works, and you are using Firefox with Web Developer toolbar, try to add a manual cookie, using this menu option:
Then, you can fill the cookie name and value.
I guess the first option will be enough in most cases, people have been reporting this problem not only in Xampp but also having problems with sessions and cookies in IE (Internet Explorer), Firefox, Chrome, etc.
Other workarounds
Use the Session Hybrid library version created by Citrusmedia, you can find it here.
Another approach could be to use Native Library, but the previous Hybrid library has been built after the author found problems with this Native Library too, so… probably you will need to test Hybrid first.



