Setting Expire on PHPRedis Sessions
<p>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. </p>

<p>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:</p>

<blockquote>
  <p>Sessions have a lifetime expressed in seconds and stored in the INI variable "session.gc_maxlifetime". You can change it with ini_set().</p>
</blockquote>

<p>It's unclear whether this is referring to the cookies lifetime or the TTL of the Redis key. I set both <code>session.cookie_lifetime</code> and <code>session.gc_maxlifetime</code> to 100000 seconds to run a test, but it looks like new session entries still start with the 1500 second TTL in Redis.</p>

<p>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?</p>