Cataly...::Redis(3pm)

πŸ“¦
version 0.901 Β· 3 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Catalyst::Plugin::Session::Store::Redis πŸ’–

okay bestie, welcome to the Cataly...::Redis page β€” that's Catalyst::Plugin::Session::Store::Redis if we're being formal, and it's straight outta the User Contributed Perl Documentation πŸ’…


✨ NAME ✨

Catalyst::Plugin::Session::Store::Redis β€” it's a Redis Session store for Catalyst. That's the whole vibe. Slay. πŸŽ€


🌸 VERSION 🌸

version 0.901 β€” yes she's got a version, she's a real one ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's how you actually use her:

use Catalyst qw/
    Session
    Session::Store::Redis
    Session::State::Foo
/;

MyApp->config->{Plugin::Session} = {
    expires => 3600,
    redis_server => '127.0.0.1:6379',
    redis_debug => 0, # or 1!
    redis_reconnect => 0, # or 1
    redis_db => 5, # or 0 by default
    redis_ssl => 1, # or 0
    redis_name => 'name',
    redis_username => 'username', # or default user
    redis_password => 'password',
    redis_ssl_verify_mode => SSL_VERIFY_PEER, # IO::Socket::SSL
};

# ... in an action:
$c->session->{foo} = 'bar'; # will be saved

like, look at that. $c->session->{foo} = 'bar'; and it just gets saved. iconic behaviour fr fr 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

Catalyst::Plugin::Session::Store::Redis is a session storage plugin for Catalyst that uses the Redis (<http://redis.io/>) key-value database. that's it. that's the girl. she stores your sessions in Redis and she does it well πŸ’–


πŸ“ CONFIGURATION πŸ“

redis_server

The IP address and port where your Redis is running. Default: 127.0.0.1:6379 β€” that's the standard spot, don't overthink it.

redis_debug

Boolean flag to turn Redis debug messages on/off. Default: 0, i.e. off. πŸ™ˆ

Turning this on will cause the Redis Perl bindings to output debug messages to STDOUT. lowkey important: this setting does not influence the logging this module does via $c->log β€” those are two separate things bestie, don't get it twisted.

ngl "Turing this on" is how the original spells it. We're keeping it. typos are canon πŸ’€

redis_reconnect

Boolean flag. Default: 0, i.e. off.

It is highly recommended that you enable this setting. If set to 0, your app might not be able to reconnect to Redis if the Redis server was restarted. and bestie, servers do restart. just saying 😭

The default stays at 0 for now because changing it might break existing apps. that's the reason. that's literally the reason.

⚠️ Do not use this setting with authentication. periodt.

redis_conservative_reconnect

Boolean flag. Default: 0, i.e. off.

Use this setting for reconnect with authentication. she's the responsible one 🧚

redis_ssl

Boolean flag. Default: 0, i.e. off.

You can connect to Redis over SSL/TLS by setting this flag if the target Redis server or cluster has been setup to support SSL/TLS. This requires IO::Socket::SSL to be installed on the client. It's off by default. ✨

redis_ssl_verify_mode

This parameter will be applied when the redis_ssl flag is set. It sets the verification mode for the peer certificate. It's compatible with the parameter with the same name in IO::Socket::SSL. πŸ’…

redis_name

Setting a different name for the connection.

redis_username

The username for the authentication.

redis_password

The password, if your Redis server requires authentication.


πŸ’œ NOTES πŸ’œ

Expired Sessions

This store does not automatically expire sessions. There is no need to call delete_expired_sessions to clear any expired sessions.

domm: No idea what this means. β€” and honestly? same. we respect the honesty though 🫢

session expiry

Currently this module does not use Redis Expiry to clean out old sessions. The author might look into this in the future. But patches are welcome! πŸ‘€βœ¨


🌈 AUTHORS 🌈

Cory G Watson, <gphat at cpan.org> πŸŽ€

Current Maintainer

Thomas Klausner <domm@cpan.org> πŸ‘‘

Contributors


⭐ AUTHOR ⭐

Thomas Klausner <domm@plix.at> πŸ’–


This software is copyright (c) 2016 - 2021 by Thomas Klausner.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. 🌸


and that's the whole page bestie!! this was perl v5.40.0, dated 2024-09-30, from the User Contributed Perl Documentation crew, and you just read Cataly...::Redis(3pm) πŸ’…βœ¨ go forth and store some sessions, you absolute main character πŸ¦‹πŸ’–

πŸ“¦ where this page comes from