PHP session runtime setting: session.gc_maxlifetime

Preface

The PHP session lifetime setting session.gc_maxlifetime defines the maximum validity for PHP sessions. By specifying the maximum validity, you can configure how long PHP sessions remain active until they are considered "garbage".


To adjust the PHP session setting session.gc_maxlifetime, first log in to our customer center at account.creoline.com with your access data.


Use the navigation to select your server under Server for which you want to change the PHP settings. Then open the Plesk Control Panel via the Plesk Control Panel menu item.


If the menu item is not displayed on your server, you will find further options for logging in in the article Logging in to the Plesk Control Panel.



Customization for a single domain

Once you are logged into Plesk, you can select the domain via the global search or the Subscriptions menu item.




You can use the PHP settings button to adjust the general PHP settings and the additional instructions:



The value session.gc_maxlifetime defines the maximum session validity for PHP sessions. This value is freely definable and is specified in the unit seconds.


After the settings have been saved, the web server automatically reloads the configuration using a graceful restart so that existing requests are not aborted but paused.



Customization for all domains

To increase or decrease the PHP settings for all domains of a PHP version, the PHP configuration file php.ini must be adjusted. To do this, select the PHP settings item via Tools & settings in the left sidebar.



Then click on the PHP version for which you want to adjust the setting globally.

You can access the PHP configuration file via the php.ini tab:



In the text field, search for the term session.gc_maxlifetime and replace the specified value with the desired new value. The default setting in Plesk is 1440 (seconds) or 24 minutes.


Then click on the OK button to save the changes. The changes will take effect immediately for all subscriptions that have the selected PHP version configured and have not been overridden using the custom PHP setting.