From 96dc7d77c0ce1951a13de465ef837daaeadeebf6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 15 Feb 2024 11:53:02 +0000 Subject: [PATCH] Bug 36098: (QA follow-up) Add POD to Koha::Session Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 09de3f820b5333e3f23f149f6b8c101d24ba15ed) Signed-off-by: Fridolin Somers (cherry picked from commit 0ff685f2289ea4e2c7aa1414f8e2e286fd8d6c84) Signed-off-by: Lucas Gass --- Koha/Session.pm | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Koha/Session.pm b/Koha/Session.pm index 68a7b2787a..8f74ee10ca 100644 --- a/Koha/Session.pm +++ b/Koha/Session.pm @@ -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 -- 2.39.5