Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
OpenXPKI::Server::SessUser:Contributed Perl OpenXPKI::Server::Session::Mock(3)

Name
       OpenXPKI::Server::Session::Mock

Description
       This class mimics the behaviour of the default session class but
       actually	does nothing stateful. In particular it	does not save the
       session information.

       However,	during the lifetime of the object instance it is possible to
       stow information	into the session object	and to retrieve	them again
       using the accessor methods.

       This is useful e. g. for	Service	implementations	that do	not need
       sessions	themselves but that rely on API	functions which	access the
       server context in order to extract session information such like	the
       current PKI realm.

       Typical usage:

	 use OpenXPKI::Server::Context qw( CTX );
	 use OpenXPKI::Server::Session::Mock;

	 my $session = OpenXPKI::Server::Session::Mock->new();
	 OpenXPKI::Server::Context::setcontext({'session' => $session});

	 CTX('session')->set_pki_realm('foobar');

       You can now use API functions that require e. g.	the PKI	realm
       information to be present in the	Context.

perl v5.24.1			  2017-07-03OpenXPKI::Server::Session::Mock(3)

Name | Description

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=OpenXPKI::Server::Session::Mock&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help