I know how to set the duration of a session (both in a PHP file and in my php.ini file), but my question is the opposite of this. How can I see what is the current session.gc_maxlife value?
I work with a variety of shared hosting environments, all of which have different values. Most are the default 24 minutes, but some have variation.
I want to be able to pop up a warning to my users just prior to session expiration, but I also want my script to figure out that time delay based on the actual server settings.
I know that I can manually look up this info with phpinfo();, but am not aware of a way to get just this single value.
Is there a command for this that my googlefu is failing me on? Has someone written a function to calculate it?
I found the answer in comments, thanks to yoda. I had to use: