View | Details | Raw Unified | Return to bug 36098
Collapse All | Expand All

(-)a/Koha/Session.pm (-2 / +30 lines)
Lines 21-26 use CGI::Session; Link Here
21
use C4::Context;
21
use C4::Context;
22
use Koha::Caches;
22
use Koha::Caches;
23
23
24
=head1 NAME
25
26
Koha::Session - Session class for Koha
27
28
=head1 SYNOPSIS
29
30
  use Koha::Session;
31
  my $session = Koha::Session->get_session({ sessionID => $sessionID});
32
33
=head1 DESCRIPTION
34
35
This simple class exposes some basic methods for managing user sessions.
36
37
=head1 METHODS
38
39
=head2 get_session
40
41
  my $session = Koha::Session->get_session({ sessionID => $sessionID});
42
43
Given a session ID, retrieves the CGI::Session object used to store
44
the session's state.  The session object can be used to store
45
data that needs to be accessed by different scripts during a
46
user's session.
47
48
If the C<$sessionID> parameter is an empty string, a new session
49
will be created.
50
51
=cut
52
24
sub _get_session_params {
53
sub _get_session_params {
25
    my $class          = shift;
54
    my $class          = shift;
26
    my $storage_method = C4::Context->preference('SessionStorage');
55
    my $storage_method = C4::Context->preference('SessionStorage');
Lines 47-53 sub _get_session_params { Link Here
47
sub get_session {
76
sub get_session {
48
    my ( $class, $args ) = @_;
77
    my ( $class, $args ) = @_;
49
    my $sessionID = $args->{sessionID};
78
    my $sessionID = $args->{sessionID};
50
    my $params = $class->_get_session_params();
79
    my $params    = $class->_get_session_params();
51
    my $session;
80
    my $session;
52
    if ($sessionID) {    # find existing
81
    if ($sessionID) {    # find existing
53
        CGI::Session::ErrorHandler->set_error(q{});    # clear error, cpan issue #111463
82
        CGI::Session::ErrorHandler->set_error(q{});    # clear error, cpan issue #111463
54
- 

Return to bug 36098