Codeigniter 3 会话与 redis - AUTH 密码

Codeigniter 3 session with redis - AUTH password

我是redis的初学者。我对 codeigniter 3 文档很困惑。

我刚刚安装了一个 redis 服务器,并在我的应用程序中使用了 ci 会话库和 redis。它工作得很好......但没有提到密码授权。

这是我的 config.php:

$config['sess_driver'] = 'redis';
$config['sess_save_path'] = 'tcp://localhost:6379';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_match_ip'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;

我应该如何申请授权?我想每个人都可以以实际方式访问我的会话 table。

session library documentation 的顶部有一堆 link,即所谓的 "table of contents"。

其中一个 link 恰当地命名为 "Redis Driver",指向...... "Redis Driver" section of the document,其中仅包含几段短文,所以你不会明白迷失在大量文本之间。

这些段落中只有一个提到了 "config" 这个词,它说的是:

Just as with the ‘files’ and ‘database’ drivers, you must also configure the storage location for your sessions via the $config['sess_save_path'] setting. The format here is a bit different and complicated at the same time. It is best explained by the phpredis extension’s README file, so we’ll simply link you to it:

https://github.com/phpredis/phpredis#php-session-handler

当然,该文档不包含单词 "authentication",但这不会造成混淆...您只需单击 link。

为清楚起见并提供一个具体示例: "tcp://host:port?auth=password"