Bug 36098: (QA follow-up) Add POD to Koha::Session

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 09de3f820b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0ff685f228)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 96dc7d77c0)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
Martin Renvoize 2024-02-15 11:53:02 +00:00 committed by Frédéric Demians
parent d917e2fc75
commit dcf85eb05a

View file

@ -21,6 +21,35 @@ use CGI::Session;
use C4::Context;
use Koha::Caches;
=head1 NAME
Koha::Session - Session class for Koha
=head1 SYNOPSIS
use Koha::Session;
my $session = Koha::Session->get_session({ sessionID => $sessionID});
=head1 DESCRIPTION
This simple class exposes some basic methods for managing user sessions.
=head1 METHODS
=head2 get_session
my $session = Koha::Session->get_session({ sessionID => $sessionID});
Given a session ID, retrieves the CGI::Session object used to store
the session's state. The session object can be used to store
data that needs to be accessed by different scripts during a
user's session.
If the C<$sessionID> parameter is an empty string, a new session
will be created.
=cut
sub _get_session_params {
my $class = shift;
my $storage_method = C4::Context->preference('SessionStorage');
@ -47,7 +76,7 @@ sub _get_session_params {
sub get_session {
my ( $class, $args ) = @_;
my $sessionID = $args->{sessionID};
my $params = $class->_get_session_params();
my $params = $class->_get_session_params();
my $session;
if ($sessionID) { # find existing
CGI::Session::ErrorHandler->set_error(q{}); # clear error, cpan issue #111463