Bug 8019

Summary: Preserve language choice between Browser sessions
Product: Koha Reporter: Marc Véron <veron>
Component: I18N/L10NAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: chris, julian.maurice, marc, paul.poulain, veron
Version: 3.10   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 8019 - Preserve language choice between Browser sessions
[SIGNED-OFF] Preserve language choice between Browser sessions

Description Marc Véron 2012-04-27 22:26:35 UTC
If I select a language in Staff client or Opac, I expect it to be persistent between browser sessions.

This is not the case. Koha forgets the selection as soon as all Broser instances are closed, and starts up the next session with the Browser's preferred language.

This behaviour is due to the Cookie KohaOpacLanguage. I expires when the browser is closed because no expiry date is set in
C4\Templates.pm, line 298 ff:

sub setlanguagecookie {
    my ( $query, $language, $uri ) = @_;
    my $cookie = $query->cookie(
        -name    => 'KohaOpacLanguage',
        -value   => $language,
        -expires => ''
    );
    print $query->redirect(
        -uri    => $uri,
        -cookie => $cookie
    );
}

Solution: Set -expires to a value like +3y (3 years from now)
Comment 1 Marc Véron 2012-04-27 22:58:12 UTC Comment hidden (obsolete)
Comment 2 Julian Maurice 2012-05-03 13:08:55 UTC
Created attachment 9401 [details] [review]
[SIGNED-OFF] Preserve language choice between Browser sessions
Comment 3 Julian Maurice 2012-05-03 13:09:14 UTC
Works as expected, signed off
Comment 4 Paul Poulain 2012-05-14 16:37:48 UTC
QA comment: tiny path, passes QA

I just lowered the severity, it's not major, the user has 1 click to do to switch back to his preffered language