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::Client::UI::SessionCookie(3) User Contributed Perl Documentation OpenXPKI::Client::UI::SessionCookie(3)

OpenXPKI::Client::UI::SessionCookie - manage the (optionally encrypted) session cookie

    my $cookie = OpenXPKI::Client::UI::SessionCookie->new(
        cgi => $cgi,
        cipher => Crypt::CBC->new(
            -key => $cipher_key,
            -pbkdf => 'opensslv2',
            -cipher => 'Crypt::OpenSSL::AES',
        ),
    );
    # decrypt cookie and fetch session ID
    my $sess_id = $cookie->fetch_id; # this might throw a decryption error
    # set session ID and create encrypted cookie
    $cookie->id($sess_id);
    $cookie->path(...); # optionally
    print $cgi->header(
        ...
        -cookie => $cookie->build,
    );

Constructor.

Parameters

  • "cgi" CGI - CGI instance
  • "cipher" Crypt::CBC - encryption cipher for the session ID (optional, default: unencrypted session ID)

Set the cookie path (only relevant for "build").

Set the session ID (only relevant for "build").

Build the HTTP cookie string containing the encrypted session ID previously set via "id" and the path set via "path".

If no cipher has been set the session ID will be stored unencrypted.

Reads the (encrypted) cookie from the "CGI" instance, decrypts it and returns the session ID.

Throws an error if the decryption fails.

Returns "undef" if no cookie was found.

Encrypt the given value.

Returns the encrypted value if a cipher was configured, or the plain input value otherwise.

Returns an empty string if no value was given.

Decrypt the given value.

Returns the decrypted value if a cipher was configured, or the plain input value otherwise.

2025-07-15 perl v5.40.2

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.