View Source Charon.SessionStore.RedisStore (Charon v2.6.0)

A persistent session store based on Redis, which implements behaviour Charon.SessionStore. In addition to the required callbacks, this store also provides get_all/3 and delete_all/3 (for a user) functions.

redis-requirements

Redis requirements

This module needs a Redis >= 6.2.0 instance.

config

Config

Additional config is required for this module (see Charon.SessionStore.RedisStore.Config):

Charon.Config.from_enum(
  ...,
  optional_modules: %{
    Charon.SessionStore.RedisStore => %{
      redix_module: MyApp.Redix,
      key_prefix: "charon_"
    }
  }
)

The following options are supported:

  • :redix_module (required). A module that implements a command/1 and a pipeline/1 function for Redis commands like Redix.
  • :key_prefix (optional). A string prefix for the Redis keys that are sessions.

redix

Redix

This module depends on a correctly configured Redix module with command/1 and pipeline/1 functions. See https://hexdocs.pm/redix for instructions.

Link to this section Summary

Functions

cleanup(config) deprecated

This should run periodically, for example once per day at a quiet moment. Deprecated; periodic cleanup is no longer required.

Link to this section Functions

This function is deprecated. Periodic cleanup is no longer required..
@spec cleanup(Charon.Config.t()) :: :ok | {:error, binary()}

This should run periodically, for example once per day at a quiet moment. Deprecated; periodic cleanup is no longer required.