Name

CatalystX::Usul::TraitFor::Controller::Cookies - Cookie multiplexing methods

Version

Describes v0.16.$Rev: 1 $

Synopsis

package YourApp::Controller::YourController;

use CatalystX::Usul::Moose;

BEGIN { extends q(CatalystX::Usul::Controller) }

sub foo {
   my ($self, $c) = @_;

   $cookie_value = $self->get_state_cookie( $c, $cookie_key );
}

Description

Allows for multiple key/value pairs to be stored in a single cookie

Configuration and Environment

Requires get_browser_state

Subroutines/Methods

$bool = $self->delete_cookie( $c, { name => $cookie_name, key => $k } );

Deletes the key / value pair from the named cookie

$bool = $self->set_state_cookie( $c, $cookie_key );

Deletes the key / value pair from the state cookie and returns true if the pair was deleted, false otherwise

get_browser_state

Modifies the base controller method. Stash key/value pairs from the browser state cookie

$value = $self->get_cookie( $c, { name => $cookie_name, key => $k } );

Get a key/value pair from the named cookie

$cookie_value = $self->set_state_cookie( $c, $cookie_key );

Returns the value from the state cookie for the specified key

$value = $self->set_cookie( $c, { name => $name, key => $k, value => $v } );

Sets a key / value pair in the named cookie

$cookie_value = $self->set_state_cookie( $c, $cookie_key, $cookie_value );

Sets the key / value pair on the state cookie. Returns the value

Diagnostics

None

Dependencies

Moose::Role

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2014 Pete Flanigan. All rights reserved

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

This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE