Catalyst::Plugin::Session

Generic Session plugin - ties together server side storage and client side state required to maintain session data
Download

Catalyst::Plugin::Session Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tomas Doran
  • Publisher web site:
  • http://search.cpan.org/~bobtfish/

Catalyst::Plugin::Session Tags


Catalyst::Plugin::Session Description

Generic Session plugin - ties together server side storage and client side state required to maintain session data The Session plugin is the base of two related parts of functionality required for session management in web applications.The first part, the State, is getting the browser to repeat back a session key, so that the web application can identify the client and logically string several requests together into a session.The second part, the Store, deals with the actual storage of information about the client. This data is stored so that the it may be revived for every request made by the same client.Catalyst::Plugin::Session links the two pieces together.SYNOPSIS # To get sessions to "just work", all you need to do is use these plugins: use Catalyst qw/ Session Session::Store::FastMmap Session::State::Cookie /; # you can replace Store::FastMmap with Store::File - both have sensible # default configurations (see their docs for details) # more complicated backends are available for other scenarios (DBI storage, # etc) # after you've loaded the plugins you can save session data # For example, if you are writing a shopping cart, it could be implemented # like this: sub add_item : Local { my ( $self, $c ) = @_; my $item_id = $c->req->param("item"); # $c->session is a hash ref, a bit like $c->stash # the difference is that it' preserved across requests push @{ $c->session->{items} }, $item_id; $c->forward("MyView"); } sub display_items : Local { my ( $self, $c ) = @_; # values in $c->session are restored $c->stash->{items_to_display} = ; $c->forward("MyView"); } Requirements: · Perl


Catalyst::Plugin::Session Related Software