Search code examples
phpgoogle-compute-enginee-commercesession-variableslamp

Session variables seem to expire within the hour


I hope this question finds you in the best of your spirits.

I have a website in PHP on lamp running on a google compute engine. The session variables seem to expire within the hour.

I have tried many fixes like:

adding the below in htaccess

php_value session.gc_maxlifetime "18000" php_value session.cache_expire "18000"

and increasing the session.cache_expire = 18000 in php.ini-production (i restarted apache after modifying the ini file)

However, none of the changes seems to work and the pain point is that if a customer keeps an order page open for more than an hour and comes back to complete it the session variables expire when they click to take it to the next page.

Any help would be hugely appreciated. Thanks in advance!


Solution

  • I think a good way of checking which file is being used could be to use the phpinfo function and then modifying the appropriate ini file to match your requirements.