Search code examples
phpsessionshared-hosting

PHP session gc_maxlifetime use master value instead of local


I'm trying to set this value to 12h on a shared hosting and totally failing. ini_get (after session_start()) return the correct seconds, also in the php_info() it show the correct local value but the session keep expiring at the master value.

I've tried to use the local php.ini and also .htaccess, and ini_set (before session_start()) too... all methods failed... Tried to set gc_probability & gc_divisors too.

I tried to open a ticket with the hosting and they told me to use php, but ini_set didn't worked. I'm clueless now, what could I try?

It's a problem of the hosting?

Thank you in advance!


Solution

  • After a brainstorming with other programmer and the worst hosting assistance ever I end up solving the problem by just changing the folder for sessions storage. This solution will also require to manage the cancellation of obsolete sessions with a cronjob.