Skip to content
Advertisement

PHP SESSION variable get’s deleted each reload

Does anybody know what can cause the $_SESSION variable to be cleared?

The session variable is used to keep track of products in the cart. Everything worked perfect on the development and production server.

Out of a sudden the production server looses the session variable – without any changes updated. The production server is hosted with 1&1.

I added some debug information which prints the contents of GET, POST and SESSION. Link to the website: http://niehues-gmbh.de

Any cart button updates the SESSION variable But any reload and other links delete the SESSION

I do call session_start() at the beginning of index.php which loads all other contents.

Advertisement

Answer

I fixed the issue by keeping the HTML / PHP standard.

If I remember right then there were white spaces before a header function which made the page not work correctly.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement