Name

Web::ComposableRequest::Role::Session - Adds a session object to the request

Synopsis

package Your::Request::Class;

use Moo;

extends 'Web::ComposableRequest::Base';
with    'Web::ComposableRequest::Role::Session';

Description

Adds a session object to the request. The "session_attr" list defines attributes (name, type, and default) which are dynamically added to the session class

Configuration and Environment

Defines the following attributes;

session

Stores the user preferences. An instance of "session_class"

session_class

Defaults to Web::ComposableRequest::Session

Defines the following configuration attributes

expire_session

A code reference which will be called passing in the session object reference when the session has expired. By default it sets the authenticated boolean to false and returns the message displayed by the application

max_messages

A non zero positive integer which defaults to 3. The maximum number of messages to keep in the queue

max_sess_time

A positive integer that defaults to 3600 seconds (one hour). The maximum amount of time a session can be idle before re-authentication is required. Setting this to zero disables the feature

session_attr

A hash reference of array references. Defaults to an empty hash. The keys are the session attribute names, the arrays are tuples containing a type and a default value

session_class

A non empty simple string which defaults to Web::ComposableRequest::Session. The name of the session base class

Subroutines/Methods

reset_session

Resets the session object so that next time it is referenced a new one is minted

Diagnostics

None

Dependencies

Digest::MD5
Subclass::Of

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to http://rt.cpan.org/NoAuth/Bugs.html?Dist=Web-ComposableRequest. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2017 Peter 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