Documentation

My Sessions Are Expiring Too Soon

If your project is experiencing Craft Commerce carts expiring quickly, or users being logged out too soon, then it may be the case that Servd's default session lengths is too short for your project. PHP's session configuration, specifically the session.cookie_lifetime and session.gc_maxlifetime settings, will need increasing.

Fortunately, PHP's session length is configurable in Servd. To change it, please perform the following steps:

  1. Navigate to your project Production or Staging Environment Variables page.

  2. Add a new environment variable. Set the key to PHP_SESSION_LENGTH and the value to the number of seconds you would like to set the session length to be.

  3. Click the "Save" button at the bottom of the environment variable list.

  4. Click the Sync button to deploy the new environment variable.