我想用php与redis会话进行会话处理,我正在这样做:
<?php
require 'Predis/Autoload.php';
Predis\Autoloader::register();
try {
$redis = new Predis\Client();
// This connection is for a remote server
$redis = new Predis\Client(array(
"scheme" => "tcp",
"host" => "xxxxxx",
"port" => xxxx,
"password" => "xxxxxxx",
"db" => "brlp_apps",
));
$redis->set('message', 'Hello world');
$value = $redis->get('message');
print($value);
echo ($redis->exists('message')) ? "Oui" : "please populate the message key";
}
catch (Exception $e) {
die($e->getMessage());
}
?>
我正在关注此tutorial。我可以与Redis数据库建立远程连接,但是如何使用它来处理会话。有什么建议吗?