Confirming Session.gc_maxlifetime only

echo phpinfo();

The code above displays various information about the PHP.
There is session.gc_maxlifetime among those information.

I like to display about session.gc_maxlifetime only instead of all information about the PHP.

The (would-be code) and target result below don’t work correctly but I hope they show what I want.

(would-be code)

echo session.gc_maxlifetime(); 



Try this and notice the difference between ini_set() and ini_get();

ini_set('display_errors', '1');

echo '<br><br> Line: ', __line__, ' ==> ', ini_Get('session.gc_maxlifetime');

echo '<br><br> Line: ', __line__, ' ==> ', ini_Set('session.gc_maxlifetime', '123');
echo '<br><br> Line: ', __line__, ' ==> ', ini_Get('session.gc_maxlifetime');


Thank you for suggesting the built-in function “ini_set() and ini_get()”

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.