Reputation: 25
I'm a beginner with redis. And i'm quite confused with the codeigniter 3 documentation.
I just installed a redis server and used the ci session library with redis in my app. It works quite well ... but nothing is mentioned concerning a password auth.
here is my 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;
How am i supposed to ask for an authantification ? I suppose that everybody could access to my session table in the actual way.
Upvotes: 2
Views: 5107
Reputation: 11
This is working to me CI3 > config.php:
$config['sess_driver'] = 'redis';
$config['sess_save_path'] = 'tcp://host*:port*?auth=password*';
Upvotes: 1
Reputation: 14752
The session library documentation has a bunch of links at its top, the so called "table of contents".
One of these links, aptly named "Redis Driver", points to ... the "Redis Driver" section of the document, which contains barely a few short paragraphs, exactly so you don't get lost in between lots of text.
Only one of those paragraphs mentions the word "config", and it says the following:
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:
Sure, the document doesn't contain the word "authentication", but this is hardly confusing ... you only have to click a link.
For clarity and to provide a specific example:
"tcp://host:port?auth=password"
Upvotes: 3