Search code examples
phpapacheopencartcentos7plesk

OpenCart Client Session Expiring


After changing our clients OpenCart (2.0.3.1) website to a new CentOS 7 + Plesk 17 server, their customers are being logged off after a period of inactivity (about 1 hour). As far as I'm aware, OpenCart doesn't auto log out shopping cart users and it's reported as new.

The php session.cookie_lifetime is set to 0 and in fact the rest of the PHP session settings are the same as the old ISPConfig server.

What could be causing this... has anyone else had a similar Apache/PHP configuration issue?

  • CentOS 7 on AWS
  • Plesk Onyx 17.0.17
  • PHP 7.1
  • MySQL (5.5.52)

Solution

  • Finally found an issue here that explains the issue and a solution.

    https://websavers.ca/plesk-php-sessions-timing-earlier-expected/

    Basically the /etc/cron.hourly/plesk-php-cleanuper is running and clearing the sessions every hour and not picking up the correct cookie_lifetime and gc_maxlifetime settings.

    Moving plesk-php-cleanuper to /etc/cron.daily/ resolves the issue.

    mv /etc/cron.hourly/plesk-php-cleanuper /etc/cron.daily/