• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Plesk and PHP sessions time out after 1 hour

Qbit

New Pleskian
We are creating a webapp that heavily uses sessions for users. We know that we needed to change some things to get this working and set the maxlifetime in the php.ini to one day instead of 1440 seconds. PHP 7.1

So our first thought was to add the maxlifetime to the Additional directives for the specified domain.
session.gc_maxlifetime = 86400

It will override the php.ini session.gc_maxlifetime = 1440 setting. After that we did
echo ini_get("session.gc_maxlifetime"); and it shows session.gc_maxlifetime = 86400. However when we started testing with some users they experienced timeouts. Also added session.gc_maxlifetime = 86400 to php.ini PHP 7.1

I just went through a day troubleshooting try and find the cause of sessions timing out. I finally found a plesk job that runs every hour by this cron script: plesk-php-cleanuper

The maxlifetime script is supposed to scan for all existing php.ini files, find the session.gc_maxlifetime value that is the largest configured value, then use it to determine when to actually clear out old sessions from the session directory.

After some testing the maxlifetime script only searches in standard OS-installed php.ini 5.4

This means that even if you’ve configured session.gc_maxlifetime to be longer than 1 hour for any given domain within Plesk, it will still have its session files cleared somewhere between the default of 24 minutes and 60 minutes.

Is there any solution for this?

Also i dont like to change php.ini for this to work because we have more than a dozen plesk servers. Best practice will be if we add the session.gc_maxlifetime to the Additional directives for the specified domain

extra info;

Version Plesk Onyx v17.5.3_build1705170317.16 os_CentOS 7
OS CentOS Linux 7.2.1511 (Core)
 
Last edited:
Back
Top