Bluz how to store session in Redis?
I am using Bluz Framework and I want to save the session in Redis, but the session continues in a file. I am using Redis 2.2.5 and Bluz 0.8.0 this is the config for my environment
return array(
"adapter" => "files",
"settings" => array(
"cache" => array(),
"files" => array(
"save_path" => PATH_DATA . '/sessions'
),
"redis" => array(
"host" => 'localhost'
)
)
);
and this is the session adapter (I got it from the debugger)
adapter = {Bluz\Session\Adapter\Redis}
settings = {array}
host = "127.0.0.1"
port = "6379"
timeout = null
persistence = false
handler
socket = {resource} resource id='195' type='Redis Socket Buffer'
prefix = "PHPSESSID"
ttl = 1800
Adapter created correctly, but the session is being written to a file. So what am I doing wrong?
source to share
Thanks for your question, We found an issue in the current version of Bluz and it was fixed in version 0.9.0 ( https://github.com/bluzphp/framework/releases/tag/0.9.0 )
If you are interested, we cannot reproduce this error with the Redis ver extension. 2.2.3, but with version 2.2.5 we caught it - a problem using the method set()
, the third parameter timeout
must be an integer type, not a string with an integer value
PS Use Bluz tag for a quick response from our team;)
source to share