Bug 8019 - Preserve language choice between Browser sessions
Summary: Preserve language choice between Browser sessions
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: 3.10
Hardware: All All
: P2 enhancement (vote)
Assignee: Marc Véron
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 22:26 UTC by Marc Véron
Modified: 2013-12-05 20:01 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 8019 - Preserve language choice between Browser sessions (1.15 KB, patch)
2012-04-27 22:58 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Preserve language choice between Browser sessions (1.18 KB, patch)
2012-05-03 13:08 UTC, Julian Maurice
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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