Apache::Session::Browseable::Cassandra(3pm)

Apache::Session::Browseable::Cassandra3pm

Apache::session backend to store sessions in a cassadra database.

Usage

  use Apache::Session::Browseable::Cassandra;
  
  my $args = {
       DataSource => 'dbi:Cassandra:host=localhost;keyspace=llng',
       UserName   => $db_user,
       Password   => $db_pass,
  
       # Choose your browseable fileds
       Index      => '_whatToTrace _session_kind _utime iAddr',
  };
  
  # Use it like Apache::Session
  my %session;
  tie %session, 'Apache::Session::Browseable::Cassandra', $id, $args;
  $session{uid} = 'me';
  $session{mail} = '[email protected]';
  $session{unindexedField} = 'zz';
  untie %session;

Overview

Apache::Session::Browseable::Cassandra is an implementation of Apache::Session for Cassandra database.

Schema

To use this module, you will need at least these columns in a table called 'sessions':

  id text
  a_session text

To create this schema, you can execute this command using cqlsh:

  CREATE TABLE sessions (
     id text PRIMARY KEY,
     a_session text
  );

Configuration

The module must know what datasource, username, and password to use when connecting to the database. These values can be set using the options hash (see Apache::Session documentation). The options are DataSource, UserName, and Password.

Example:

 tie %hash, 'Apache::Session::Cassandra', $id, {
     DataSource => 'dbi:Cassandra:host=localhost;keyspace=llng',
     UserName   => 'database_user',
     Password   => 'K00l'
 };

Instead, you may pass in an already-opened DBI handle to your database.

 tie %hash, 'Apache::Session::Cassandra', $id, {
     Handle => $dbh
 };

From libapache-session-browseable-perl 1.3.16-1+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.