I've got Redis running a shared session storage for several subdomains that I access through PHPRedis. The session cookie has a nice long lifetime so users don't have to log in too often, but I find I have to log in about every half hour anyway.
Examining the Redis instance shows that the TTL for each key is set pretty low by default (about 1500 seconds). The PHPRedis docs have this to say:
Sessions have a lifetime expressed in seconds and stored in the INI variable "session.gc_maxlifetime". You can change it with ini_set().
It's unclear whether this is referring to the cookies lifetime or the TTL of the Redis key. I set both session.cookie_lifetime and session.gc_maxlifetime to 100000 seconds to run a test, but it looks like new session entries still start with the 1500 second TTL in Redis.
It's pretty clear how to set the TTL when interacting with Redis directly, but I don't know how to set this value through PHPRedis' session manager. Any tips?
ini_set()before the session is started. I'll check out if changing the .ini file acts any different.ini_set()doesn't work, as now I have to make php.ini changes on each of our servers instead of just having the source code do it for me.