I am trying to increase my php session time to 6 hours.
Here is the code to increase the session time:
ini_set(\'session.gc_maxlifetime\', 60 * 60 * 6);
Increasing session.gc_maxlifetime via ini_set may not work if there is another script that runs (e.g. an other vhost) that uses the same session.save_path. The other script removes the sessions of all scripts by its own lifetime:
Note:
If different scripts have different values of session.gc_maxlifetime but share the same place for storing the session data then the script with the minimum value will be cleaning the data. In this case, use this directive together with session.save_path.
Source: http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime
Also be sure to change the setting before session_start(). If you have session.auto_start enabled, it is to late when you use ini_set.