NAME

PSGI::Hector::Session - Session class

SYNOPSIS

        my $s = $hector->getSession();
        $s->setVar('name', 'value');
        my $var = $s->getVar('name');

DESCRIPTION

Class to deal with session management.

METHODS

new()

        my $session = PSGI::Hector::Session->new($hector)

Reads or creates a new session for the visitor.

The correct Set-Cookie header will be issued through the provided PSGI::Hector::Response object.

setVar()

        $s->setVar('name', 'value');

Takes two arguments, first the name of the variable then the value of the variable to store.

setSecretVar()

        $s->setSecretVar('name', 'value');

Takes two arguments, first the name of the variable then the value of the variable to store.

The value is encrypted before being stored.

getVar()

        my $value = $s->getVar('name')

Retrieves the value which corresponds to the given variable name.

getSecretVar()

        my $value = $s->getSecretVar('name')

Retrieves the value which corresponds to the given variable name.

The value is decrypted before being returned.

delete()

Remove the current session from memory, disk and expire it in the browser.

Notes

Author

MacGyveR <dumb@cpan.org>

Development questions, bug reports, and patches are welcome to the above address

See Also

Copyright

Copyright (c) 2020 MacGyveR. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.