Доброго всем

¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !

Mojolicious::Plugin::RoutesAuthDBI::Guest

The code of module is mostly copy/paste from Mojolicious::Plugin::Authentication 1.29

NAME

Mojolicious::Plugin::RoutesAuthDBI::Guest - session for guests. Store guests in separate DBI table.

SYNOPSIS

    $app->plugin('RoutesAuthDBI', 
        ...
        guest => {< options list below >},
        ...
    );

OPTIONS

  • namespace - default 'Mojolicious::Plugin::RoutesAuthDBI',

  • module - default 'Guest' (this module),

  • session_key - session storage of guest data. Default 'guest_data'.

  • stash_key -

  • -

METHODS

current($controller)

Get current guest hashref by session and undef overwise.

  my $guest = $c->access->plugin->guest->current($c);

store($controller, $data)

Store guest data in DB table and set session_key. Headers of request save in "data" column.

  $c->access->plugin->guest->store($c, {"Glory"=>"is ♥ for me"});

is_guest($controller)

True if current session of guest.

  if( $c->access->plugin->guest->is_guest($c) ) {...}

load($id)

Loads guest data from DB table by its ID row. JSON column "data" will expand.

  my $data = $c->access->plugin->guest->load($id);

reload($controller)

Cleanup stash and reload guest data.

  my $guest = $c->access->plugin->guest->reload($c);

SEE ALSO

Mojolicious::Plugin::Authentication

AUTHOR

Михаил Че (Mikhail Che), <mche [on] cpan.org>

BUGS / CONTRIBUTING

Please report any bugs or feature requests at https://github.com/mche/Mojolicious-Plugin-RoutesAuthDBI/issues. Pull requests welcome also.

COPYRIGHT

Copyright 2016 Mikhail Che.

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