From 1394233393a640145b8aff8e7f3cb5c77c13366c Mon Sep 17 00:00:00 2001 From: Jacob Christiansen Date: Mon, 19 Jan 2015 13:24:21 +0100 Subject: [PATCH] Let module decide lifetime of keys --- config-templates/module_redis.php | 9 ++++++++- enable | 0 lib/Store/Redis.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 enable diff --git a/config-templates/module_redis.php b/config-templates/module_redis.php index c0163a5..d9fb657 100644 --- a/config-templates/module_redis.php +++ b/config-templates/module_redis.php @@ -1,7 +1,14 @@ 'tcp://localhost:6379', + // Key prefix - 'prefix' => 'simplaSAMLphp' + 'prefix' => 'simplaSAMLphp', + + // Lifitime for all non expiring keys + 'lifetime' => 288000 ); diff --git a/enable b/enable new file mode 100644 index 0000000..e69de29 diff --git a/lib/Store/Redis.php b/lib/Store/Redis.php index ff3d56f..2b6456e 100644 --- a/lib/Store/Redis.php +++ b/lib/Store/Redis.php @@ -19,7 +19,7 @@ protected function __construct() $this->redis = new Predis\Client($redisConfig->getString('host', 'localhost')); $this->prefix = $redisConfig->getString('prefix', 'simpleSAMLphp'); - $this->lifeTime = $globalConfig->getInteger('session.duration', 28800); // Default 8 hours + $this->lifeTime = $redisConfig->getInteger('lifetime', 28800); // 8 hours } /**