This question already has an answer here:
I've configured session values in php.ini, for example session.gc_maxlifetime = 86400
, but the changes don't take effect after restarting apache, as shown in the images:
</div>
You can modify the default ttl of the sessions directly in your script:
ini_set("session.gc_maxlifetime", 86400);
session_start();
But as noticed in the documentation, you must take in account that:
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.
Then you should digg around session.save_path too.