We've got a very odd issue with our Magento installation which has suddenly started periodically logging us out of the back end whilst simultaneously on the front end it seems to forget peoples session. So on the back end you're suddenly sent to the log in page and even if you can log in again you get logged out pretty much straight away if you click on anything. Then on the front end weird things happen like if you click 'add to basket' it just sends customers to 'there is nothing in your basket' page. Refreshing the page sometimes puts the item back in the basket. If customers are logged in then suddenly they are logged out as well. It's like it's alternating between forgetting and remembering the session.

We have 2 web servers, a database server and a load balancer. My thought was it was an issue with the sessions being stored incorrectly but the hosting company have investigated and everything seems correct from their end. We store sessions in redis across both servers.

It only happens periodically - like once a day for approx 20-30 mins which makes it infuriating to capture. By the time I get hold of the server company it's starting to resolve itself and they can't replicate the issue.

Long shot but anyone any ideas what could be causing this?



If you have two frontends you are probably facing a session issue.

Make sure you are using a shared session backend.

If you are using redis make sure both the frontend are configured to access the same installation. Otherwise just make sure you are using database stored sessions.

In your app/etc/local.xml file make sure you have:


One other problem could be a time gap between your two frontends. Make sure you have the same time on both of them.

P.S: Remember to flush the cache.

  • Thanks for your help Riccardo. I noticed someone else had mentioned the time issue in relation to a similar problem and I had the server people check - both web servers are on the same time. I will check with them about the XML configuration. I'm sure they wouldn't have missed that but who knows - we are storing sessions on the database. It is peculiar how it's something that only happens intermittently - kinda suggests the issue occurs when something else is running like a chron job or something but we can't uncover anything like that. – Doctor Nefario Feb 22 '16 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.