I have tried a lot of solutions to prevent sessions expiring, but no onw has worked, the last solution was to set
session.gc_maxlifetime = 0
session.gc_probability = 0
But it doesnt work, any other idea to prevent the session expiring?
I have tried a lot of solutions to prevent sessions expiring, but no onw has worked, the last solution was to set
session.gc_maxlifetime = 0
session.gc_probability = 0
But it doesnt work, any other idea to prevent the session expiring?
It is a bad idea to do that, but to answer the question ... you can override the default session handler with a custom one and have it ignore the GC calls:
class NoGCSessionHandler extends SessionHandler {
public function gc($maxlifetime)
{
return true;
}
}
session_set_save_handler(new NoGCSessionHandler());