The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Dancer::Session::ElasticSearch - ElasticSearch based session engine for Dancer

SYNOPSIS

This module implements a session engine storing session variables in an ElasticSearch index.

USAGE

In config.yml

  session:       "ElasticSearch"
  session_options:
    connection:
    ... settings to pass to L<ElasticSearch>
    index: "my_index" # defaults to "session"
    type:  "my_session" # defaults to "session"

This session engine will not remove expired sessions on the server, but as it's ElasticSearch you know when sessions were last updated from the document timestamp.

METHODS

create()

Creates a new session. Returns the session object.

flush()

Write the session to ES. Returns the session object.

retrieve($id)

Look for a session with the given id.

Returns the session object if found, undef if not.

destroy()

Remove the current session object from ES

INTERNAL METHODS

_es

Connect to ElasticSearch and returns a handle

FORK ME

Fork a copy for yourself from https://github.com/babf/Dancer-Session-ElasticSearch

SEE ALSO

Dancer, Dancer::Session