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

NAME

Catalyst::Plugin::Session::State::Header - Manipulate session IDs by auth headers.

SYNOPSIS

    use Catalyst qw/Session Session::State::Header Session::Store::Foo/;
    ...;
    __PACKAGE__->config('Plugin::Session' => {
        auth_header => 'x-auth',
        allowed_uri => '^/api/',
    });

DESCRIPTION

In order for Catalyst::Plugin::Session to work the session data needs to be stored on the server. To link session on server with client we need to pass somehow session_id to the server, and server should accept it.

This plugin accepts session_id using headers. It is usable for APIs, when we need to path auth information in the headers, for example, in x-auth header.

CONFIGURATION

auth_header

Header name, in which authentication info should be passed. For example, x-auth.

allowed_uri

Regexp for URI validation. If specified, this plugin will be enabled only for paths matched by regexp that was provided. Otherwise, all URIs will be affected.

METHODS

extend_session_id
set_session_id
get_session_id
delete_session_id
uni_path

Returns unified catalyst path with heading and ending slashes and withoud slash repetitions. Catalyst path ($c->request->path()) returns controller path as is, so, it path could be: api///login/ api/login api/login///

But for catalyst these paths are the same, so, this method will return /api/login/ for each of them.

SEE ALSO

Catalyst Catalyst::Plugin::Session Catalyst::Plugin::Session::State::Cookie Catalyst::Plugin::Session::State::URI

LICENSE

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.