diff options
author | Remi Collet <remi@remirepo.net> | 2018-06-08 11:55:02 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2018-06-08 11:55:02 +0200 |
commit | b6c457247052c36a60c4d3b53c2256db22a8a62c (patch) | |
tree | d78eb45784a9c3c3b2d6d13e9fe9f1b887456188 /getSessionData.php | |
parent | a4b4a23c74418534d48cee41123c93277cb08155 (diff) |
update to 4.0.2
open https://github.com/phpredis/phpredis/pull/1365 use PHP_BINARY instead of php and allow override
report https://github.com/phpredis/phpredis/issues/1364 missing files in pecl archive
add new redis.session.lock* options in provided configuration
Diffstat (limited to 'getSessionData.php')
-rw-r--r-- | getSessionData.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/getSessionData.php b/getSessionData.php new file mode 100644 index 0000000..d49256c --- /dev/null +++ b/getSessionData.php @@ -0,0 +1,22 @@ +<?php +error_reporting(E_ERROR | E_WARNING); + +$redisHost = $argv[1]; +$saveHandler = $argv[2]; +$sessionId = $argv[3]; +$sessionLifetime = $argv[4]; + +if (empty($redisHost)) { + $redisHost = 'tcp://localhost:6379'; +} + +ini_set('session.save_handler', $saveHandler); +ini_set('session.save_path', $redisHost); +ini_set('session.gc_maxlifetime', $sessionLifetime); + +session_id($sessionId); +if (!session_start()) { + echo "session_start() was nut successful"; +} else { + echo isset($_SESSION['redis_test']) ? $_SESSION['redis_test'] : 'Key redis_test not found'; +} |