MasonX::Request::WithMultiSession(3pm) User Contributed Perl Documentation MasonX::Request::WithMultiSession(3pm)

MasonX::Request::WithMultiSession - Multiple sub-sessions within one "parent" session

  PerlSetVar  MasonRequestClass  MasonX::Request::WithMultiSession

This module subclasses "MasonX::Request::WithApacheSession" in order to allow multiple "sub-sessions" to exist within one parent session.

This can be quite useful for a web app where you want to allow the user to open multiple windows, each with a different session, but session ids are stored in a cookie.

Like "MasonX::Request::WithApacheSession", sub-sessions are shared between a request and any subrequests it creates.

This class has an interface quite similar to that of "MasonX::Request::WithApacheSession".

This module takes two parameters besides those inherited from "MasonX::Request::WithApacheSession":

  • multi_session_args_param / MultiSessionArgsParam

    This parameter can be used to specify which parameter contains the sub-session id. By default, the module will look for a parameter called "sub_session_id".

  • multi_session_expire / MultiSessionExpire

    This parameter specifies the number of seconds after a sub-session is accessed until it is purged. If not specified, then sub-sessions are never purged.

    Sub-sessions expiration is checked when the request object goes out of scope.

You will need to manually set the sub-session id argument parameter for each request. The easiest way to do this is to make sure that all URLs contain the sub-session id. This can be done by using a "<%filter>" block in a top-level autohandler (although this won't catch redirects), or by making sure all URLs are generated by a single component/function.

Bug reports and requests for help should be sent to the mason-users list. See http://www.masonhq.com/resources/mailing_lists.html for more details.

Dave Rolsky, <autarch@urth.org>

Development funded by Marigold Technologies.

HTML::Mason

2022-10-13 perl v5.36.0