Session Problem


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.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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:




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