Here are the code of my login page where the login script checks for the authenticity of the user and then redirects to inbox page using header function.
<
I encountered this issue today. the issue has to do with the $config['base_url'] . I noticed htpp://www.domain.com and http://example.com was the issue. to fix , always set your base_url to http://www.example.com
Maybe if your session path is not working properly you can try session.save_path(path/to/any folder);
function as alternative path. If it works you can ask your hosting provider about default path issue.
I had similar issue and with the cookie domain:
ini_set('session.cookie_domain', '.domain.com');
the domain was setup wrong so all sessions were ignored because the user cookie was never set right hope this will help someone.
I was also facing the same problem i did the following steps to resolve the issue
2 After that just changed the permission given below *chown root.apache /var/lib/php/session * That's it. These above steps resolve my issue