The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Plugin::WWWSession - WWW:Session sessions for Mojolicious

VERSION

Version 0.01

SYNOPSIS

This module allows you to overwrite the standard Mojolicious session with a WWW:Session object and enjoy all the goodies it provides

Example :

In you apllication module add the fallowing lines

    use Mojolicious::Plugin::WWWSession;

    sub startup {
    
        ...
    
        #Overwrite session
        $self->plugin( WWWSession => { storage => [File => {path => '.'}] } );

        ...
    }

Possible options for the plugin are :

    {
    storage => [ 'File' => { path => '/tmp/sessions'},
                 'Memcached' => { servers => ['127.0.0.1'] }
               ],
    serialization => 'JSON',
    expires => 3600,
    fields => {
              user => {
                      inflate => sub { return Some::Package->new( $_[0]->id() ) },
                      deflate => sub { $_[0]->id() },
              }
    }
    

See WWW:Session for more details on possible options and on how you can use the session

If you use the "Storable" serialization engine you can store objects in the session. Also multiple session storage backends can be used simultaneously

METHODS

register

Called by Mojo when you register the plugin

AUTHOR

Gligan Calin Horea, <gliganh at gmail.com>

BUGS

Please report any bugs or feature requests to bug-mojolicious-plugin-wwwsession at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mojolicious-Plugin-WWWSession. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Mojolicious::Plugin::WWWSession

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2012 Gligan Calin Horea.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.