Session Problem

November 9, 2017 1.3k views
PHP Frameworks

Hello,

I Have transferred my website, import database… website is working very well..
Only issue i have and i can’t find why… sessions is not working.

When i want add something into the cart and want see my cart it says it is empty.
and login success and then redirecting to login page again
So the session is not working correct.. try check the sessions settings in php.ini and match them with my old hosting did not work.

Can you give me the steps i need to do so i learn from it.

1 Answer

Hello,

This usually happens if you have a custom php.ini somewhere within your public folder.

One of the ways to troubleshoot this would be to add a php info file and check which php.ini files are being loaded and what are your session values set to.

The php info syntax would look something like this:

<?php

phpinfo();

?>

Save that in a file called info.php for example and access it via your browser. What you need to look for is:

  • The Loaded Configuration File and the Additional .ini files parsed sections. You need to make sure that there are no custom files loaded that could be causing the problem for you.

  • Then check the session section, in particular the session.save_handler. If it is set to files make sure that session.save_path directory is writable.

Hope that this helps!
Regards,
Bobby

Have another answer? Share your knowledge.