|
NAMEOpenXPKI::Server::Session - Factory to create, persist and resume sessionsSYNOPSISTo start a new session:my $session = OpenXPKI::Server::Session->new(load_config => 1)->create; $session->data->pki_realm("democa"); ... $session->persist; To resume an existing session: my $session = OpenXPKI::Server::Session->new(load_config => 1); $session->resume($id); Or if you want to specify config and logger explicitely: my $session = OpenXPKI::Server::Session ->new( type => "Database", config => { dbi => $dbi }, log => OpenXPKI::Server::Log->new, ) ->create; ... The parameters in the "config" HashRef are directly passed as constructor parameters to the session driver class (i.e. to "OpenXPKI::Server::Session::Driver::Database->new" in the example) STATIC METHODSnewConstructor that creates a new session with an empty data object.METHODSidAccessor to get or set the session ID (shortcut for "$session->data->id").is_validAccessor to mark the session as "valid" or query the current state (shortcut for "$session->data->is_valid").data_as_hashrefReturns a HashRef containing names and values of all previously set session attributes.Parameters
is_initializedReturns 1 if the session is initialized, i.e. either data has been set or a persisted session was resumed.createCreates a new sesssion.resumeResume the specified session by loading its data from the backend storage.Returns the object reference to "OpenXPKI::Server::Session" if the session was successfully resumed or undef otherwise (i.e. expired session or unknown ID). Parameters
persistSaves the session to the backend storage if any session data has changed.Returns 1 if data was actually written to the backend, "undef" otherwise. Named parameters
deleteDeletes the session data from the backend storage and then from this session object, so that it cannot be access anymore.Returns 1 if data was actually written to the backend or "undef" if there is no session data yet. new_idSwitches the session to a new ID and updates the backend.Returns the new session ID. purge_expiredDeletes all sessions that are expired from the backend storage.is_expiredReturns true if the current session is expired.
Visit the GSP FreeBSD Man Page Interface. |