PUBLIC

BLM::Startup::RedisSession - Redis based sessions

SYNOPSIS

<pre>
  <trace --output $session>
</pre>

DESCRIPTION

Provides a pesistent session store for anonymous or login sessions. See BLM::Startup::UserSession for more details on sessions.

Using a memory cache like Redis for session management offers several advantages over using a traditional database:

CONFIGURATION

Create a Bedrock XML file named redis-session.xml and place that in one of Bedrock's configuration paths.

Note that you can only have one session class bound to the $session object.

<!-- Bedrock RedisSessions -->
<object>
  <scalar name="binding">session</scalar>
  <scalar name="session">yes</scalar>
  <scalar name="module">BLM::Startup::RedisSession</scalar>

  <object name="config">
    <scalar name="verbose">2</scalar>
    <scalar name="param">session</scalar>

    <!-- Redis connect information -->
    <scalar name="server">localhost</scalar>
    <scalar name="port">6379</scalar>

    <object name="cookie">
      <scalar name="path">/</scalar>
      <scalar name="expiry_secs">3600</scalar>
      <scalar name="domain"></scalar>
    </object>
  </object>
</object>

METHODS AND SUBROUTINES

Implements the bare minimium methods for session management using a Redis server. See BLM::Startup:SessionManager for more details on how sessions work and what methods are available. This class uses the Bedrock::Role::RedisClient role.

FETCH_SESSION

Uses the Redis get method to retrieve data from the Redis server.

KILL_SESSSION

Uses the Redis del method to retrieve data from the Redis server.

STORE_SESSION

Uses the Redis set method to store data from the Redis server. Use the expires method to set the ttl on keys based on the current cookie expiration time.

AUTHOR

Andy Layton

Rob Lauer - rlauer6@comcast.net

SEE OTHER

Bedrock::RedisClient, BLM::Startup::BaseSession, BLM::Startup::SessionManager Bedrock::Apache::RedisSessionHandler