GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Server::Session(3) User Contributed Perl Documentation OpenXPKI::Server::Session(3)

OpenXPKI::Server::Session - Factory to create, persist and resume sessions

To 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)

Constructor that creates a new session with an empty data object.

Accessor to get or set the session ID (shortcut for "$session->data->id").

Accessor to mark the session as "valid" or query the current state (shortcut for "$session->data->is_valid").

Returns a HashRef containing names and values of all previously set session attributes.

Parameters

@attrs - optional: list of attribute names if only a subset shall be returned.

Returns 1 if the session is initialized, i.e. either data has been set or a persisted session was resumed.

Creates a new sesssion.

Resume 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

$id - session ID

Saves 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

force - "Bool" force writing session even if nothing has changed. This will update the modified timestamp of the stored session.

Deletes 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.

Switches the session to a new ID and updates the backend.

Returns the new session ID.

Deletes all sessions that are expired from the backend storage.

Returns true if the current session is expired.
2022-05-14 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.