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

(-)a/C4/Auth.pm (-9 / +9 lines)
Lines 269-275 sub get_template_and_user { Link Here
269
                -value    => '',
269
                -value    => '',
270
                -HttpOnly => 1,
270
                -HttpOnly => 1,
271
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
271
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
272
                -sameSite => 'Lax',
272
                -sameSite => C4::Context->preference('SameSiteSessionCookie'),
273
            ));
273
            ));
274
274
275
            #NOTE: This JWT should only be used by the self-check controllers
275
            #NOTE: This JWT should only be used by the self-check controllers
Lines 863-869 sub checkauth { Link Here
863
            -value    => '',
863
            -value    => '',
864
            -HttpOnly => 1,
864
            -HttpOnly => 1,
865
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
865
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
866
            -sameSite => 'Lax',
866
            -sameSite => C4::Context->preference('SameSiteSessionCookie')
867
        ));
867
        ));
868
    }
868
    }
869
    elsif ( $emailaddress) {
869
    elsif ( $emailaddress) {
Lines 936-942 sub checkauth { Link Here
936
                    -value    => $session->id,
936
                    -value    => $session->id,
937
                    -HttpOnly => 1,
937
                    -HttpOnly => 1,
938
                    -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
938
                    -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
939
                    -sameSite => 'Lax',
939
                    -sameSite => C4::Context->preference('SameSiteSessionCookie'),
940
                ));
940
                ));
941
941
942
                $flags = haspermission( $userid, $flagsrequired );
942
                $flags = haspermission( $userid, $flagsrequired );
Lines 1010-1016 sub checkauth { Link Here
1010
            -value    => $sessionID,
1010
            -value    => $sessionID,
1011
            -HttpOnly => 1,
1011
            -HttpOnly => 1,
1012
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1012
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1013
            -sameSite => 'Lax',
1013
            -sameSite =>  C4::Context->preference('SameSiteSessionCookie'),
1014
        ));
1014
        ));
1015
        my $pki_field = C4::Context->preference('AllowPKIAuth');
1015
        my $pki_field = C4::Context->preference('AllowPKIAuth');
1016
        if ( !defined($pki_field) ) {
1016
        if ( !defined($pki_field) ) {
Lines 1218-1224 sub checkauth { Link Here
1218
                                -value    => '',
1218
                                -value    => '',
1219
                                -HttpOnly => 1,
1219
                                -HttpOnly => 1,
1220
                                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1220
                                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1221
                                -sameSite => 'Lax',
1221
                                -sameSite => C4::Context->preference('SameSiteSessionCookie'),
1222
                            ));
1222
                            ));
1223
                            $info{'wrongip'} = 1;
1223
                            $info{'wrongip'} = 1;
1224
                            $auth_state = "failed";
1224
                            $auth_state = "failed";
Lines 1331-1337 sub checkauth { Link Here
1331
                -value    => '',
1331
                -value    => '',
1332
                -HttpOnly => 1,
1332
                -HttpOnly => 1,
1333
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1333
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1334
                -sameSite => 'Lax',
1334
                -sameSite => C4::Context->preference('SameSiteSessionCookie'),
1335
            ));
1335
            ));
1336
        }
1336
        }
1337
1337
Lines 1522-1528 sub checkauth { Link Here
1522
            charset           => 'utf-8',
1522
            charset           => 'utf-8',
1523
            cookie            => $cookie,
1523
            cookie            => $cookie,
1524
            'X-Frame-Options' => 'SAMEORIGIN',
1524
            'X-Frame-Options' => 'SAMEORIGIN',
1525
            -sameSite => 'Lax'
1525
            -sameSite => C4::Context->preference('SameSiteSessionCookie')
1526
        }
1526
        }
1527
      ),
1527
      ),
1528
      $template->output;
1528
      $template->output;
Lines 1606-1612 sub check_api_auth { Link Here
1606
            -value    => $session->id,
1606
            -value    => $session->id,
1607
            -HttpOnly => 1,
1607
            -HttpOnly => 1,
1608
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1608
            -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1609
            -sameSite => 'Lax'
1609
            -sameSite => C4::Context->preference('SameSiteSessionCookie')
1610
        );
1610
        );
1611
        return ( $return, $cookie, $session ); # return == 'ok' here
1611
        return ( $return, $cookie, $session ); # return == 'ok' here
1612
1612
Lines 1648-1654 sub check_api_auth { Link Here
1648
                -value    => $sessionID,
1648
                -value    => $sessionID,
1649
                -HttpOnly => 1,
1649
                -HttpOnly => 1,
1650
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1650
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
1651
                -sameSite => 'Lax'
1651
                -sameSite => C4::Context->preference('SameSiteSessionCookie')
1652
            );
1652
            );
1653
            if ( $return == 1 ) {
1653
            if ( $return == 1 ) {
1654
                my (
1654
                my (
(-)a/C4/InstallAuth.pm (-4 / +4 lines)
Lines 270-276 sub checkauth { Link Here
270
                -value    => $session->id,
270
                -value    => $session->id,
271
                -HttpOnly => 1,
271
                -HttpOnly => 1,
272
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
272
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
273
                -sameSite => 'Lax'
273
                -sameSite => C4::Context->preference('SameSiteSessionCookie')
274
            );
274
            );
275
            $loggedin = 1;
275
            $loggedin = 1;
276
            $userid   = $session->param('cardnumber');
276
            $userid   = $session->param('cardnumber');
Lines 302-308 sub checkauth { Link Here
302
                -value    => $sessionID,
302
                -value    => $sessionID,
303
                -HttpOnly => 1,
303
                -HttpOnly => 1,
304
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
304
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
305
                -sameSite => 'Lax'
305
                -sameSite => C4::Context->preference('SameSiteSessionCookie')
306
            );
306
            );
307
            if ( $return == 2 ) {
307
            if ( $return == 2 ) {
308
308
Lines 350-356 sub checkauth { Link Here
350
                -HttpOnly => 1,
350
                -HttpOnly => 1,
351
                -expires => '',
351
                -expires => '',
352
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
352
                -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
353
                -sameSite => 'Lax'
353
                -sameSite => C4::Context->preference('SameSiteSessionCookie')
354
            );
354
            );
355
        }
355
        }
356
        if ($envcookie) {
356
        if ($envcookie) {
Lines 401-407 sub checkauth { Link Here
401
        -HttpOnly => 1,
401
        -HttpOnly => 1,
402
        -expires => '',
402
        -expires => '',
403
        -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
403
        -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
404
        -sameSite => 'Lax'
404
        -sameSite => C4::Context->preference('SameSiteSessionCookie')
405
    );
405
    );
406
    print $query->header(
406
    print $query->header(
407
        -type    => 'text/html; charset=utf-8',
407
        -type    => 'text/html; charset=utf-8',
(-)a/C4/Templates.pm (-1 / +1 lines)
Lines 354-360 sub getlanguagecookie { Link Here
354
        -value   => $language,
354
        -value   => $language,
355
        -HttpOnly => 1,
355
        -HttpOnly => 1,
356
        -expires => '+3y',
356
        -expires => '+3y',
357
        -sameSite => 'Lax',
357
        -sameSite => C4::Context->preference('SameSiteSessionCookie'),
358
        -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
358
        -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
359
    );
359
    );
360
360
(-)a/cataloguing/additem.pl (-2 / +2 lines)
Lines 220-226 if ($load_template_submit || $unload_template_submit) { Link Here
220
        -value    => $cookie_value,
220
        -value    => $cookie_value,
221
        -HttpOnly => 1,
221
        -HttpOnly => 1,
222
        -expires  => '',
222
        -expires  => '',
223
        -sameSite => 'Lax'
223
        -sameSite => C4::Context->preference('SameSiteSessionCookie')
224
    );
224
    );
225
225
226
    $cookie = [ $cookie, $template_cookie ];
226
    $cookie = [ $cookie, $template_cookie ];
Lines 348-354 if ($op eq "cud-additem") { Link Here
348
                    -value   => encode_base64url( freeze( { %{$item->unblessed}, itemnumber => undef } ) ),
348
                    -value   => encode_base64url( freeze( { %{$item->unblessed}, itemnumber => undef } ) ),
349
                    -HttpOnly => 1,
349
                    -HttpOnly => 1,
350
                    -expires => '',
350
                    -expires => '',
351
                    -sameSite => 'Lax'
351
                    -sameSite => C4::Context->preference('SameSiteSessionCookie')
352
                );
352
                );
353
353
354
                $cookie = [ $cookie, $last_created_item_cookie ];
354
                $cookie = [ $cookie, $last_created_item_cookie ];
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc (-1 / +1 lines)
Lines 12-18 function mergeAuth(authid, summary) { Link Here
12
        }
12
        }
13
        window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
13
        window.location.href = "/cgi-bin/koha/authorities/merge.pl?authid=" + authid + "&authid=" + alreadySelected.authid + refstring;
14
    } else {
14
    } else {
15
        Cookies.set('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/', sameSite: 'Lax' });
15
        Cookies.set('auth_to_merge', JSON.stringify({ 'authid': authid, 'summary': summary }), { 'path' : '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
16
        showMergingInProgress();
16
        showMergingInProgress();
17
    }
17
    }
18
}
18
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-1 / +1 lines)
Lines 979-985 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
979
    function changeEditor() {
979
    function changeEditor() {
980
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
980
            if ( !confirm( _("Any changes will not be saved. Continue?") ) ) return;
981
981
982
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: 'Lax'} );
982
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "basic", { expires: 365, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' } );
983
983
984
            if ( state.backend == 'catalog' ) {
984
            if ( state.backend == 'catalog' ) {
985
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
985
                window.location = '/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=' + state.recordID;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt (-1 / +1 lines)
Lines 344-350 Link Here
344
            }));
344
            }));
345
            $("#select_display").on("change",function(){
345
            $("#select_display").on("change",function(){
346
                var checked = $(this).prop("checked") ? 1: 0;
346
                var checked = $(this).prop("checked") ? 1: 0;
347
                Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: 'Lax' });
347
                Cookies.set("marctagstructure_selectdisplay", checked, { sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
348
                this.form.submit();
348
                this.form.submit();
349
            });
349
            });
350
        });
350
        });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt (-5 / +6 lines)
Lines 43-49 Link Here
43
43
44
        if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
44
        if ( !confirm( breedingid ? _("This record cannot be transferred to the advanced editor. Continue?") : _("Any changes will not be saved. Continue?") ) ) return false;
45
45
46
        Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: 'Lax'  } );
46
        Cookies.set( 'catalogue_editor_[% logged_in_user.borrowernumber | html %]', 'advanced', { expires: 365, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' } );
47
47
48
        var biblionumber = [% biblionumber || "null" | html %];
48
        var biblionumber = [% biblionumber || "null" | html %];
49
49
Lines 543-553 $(document).ready(function(){ Link Here
543
    function toggleMARCdocLinks(flag){
543
    function toggleMARCdocLinks(flag){
544
        if( flag === true ){
544
        if( flag === true ){
545
            $(".marcdocs").show();
545
            $(".marcdocs").show();
546
            Cookies.set("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: 'Lax'  });
546
547
            Cookies.set("marcdocs_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
547
            $("#marcDocsSelect i").addClass('fa-check-square').removeClass('fa-square');
548
            $("#marcDocsSelect i").addClass('fa-check-square').removeClass('fa-square');
548
        } else {
549
        } else {
549
            $(".marcdocs").hide();
550
            $(".marcdocs").hide();
550
            Cookies.set("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: 'Lax'  });
551
            Cookies.set("marcdocs_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
551
            $("#marcDocsSelect i").removeClass('fa-check-square').addClass('fa-square');
552
            $("#marcDocsSelect i").removeClass('fa-check-square').addClass('fa-square');
552
        }
553
        }
553
    }
554
    }
Lines 556-567 $(document).ready(function(){ Link Here
556
        if( flag === true ){
557
        if( flag === true ){
557
            $(".tagnum").show();
558
            $(".tagnum").show();
558
            $(".subfieldcode").show();
559
            $(".subfieldcode").show();
559
            Cookies.set("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: 'Lax'  });
560
            Cookies.set("marctags_[% borrowernumber | html %]",'show', { path: "/", expires: 365, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
560
            $("#marcTagsSelect i").addClass('fa-check-square').removeClass('fa-square');
561
            $("#marcTagsSelect i").addClass('fa-check-square').removeClass('fa-square');
561
        } else {
562
        } else {
562
            $(".tagnum").hide();
563
            $(".tagnum").hide();
563
            $(".subfieldcode").hide();
564
            $(".subfieldcode").hide();
564
            Cookies.set("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: 'Lax'  });
565
            Cookies.set("marctags_[% borrowernumber | html %]",'hide', { path: "/", expires: 365, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
565
            $("#marcTagsSelect i").removeClass('fa-check-square').addClass('fa-square');
566
            $("#marcTagsSelect i").removeClass('fa-check-square').addClass('fa-square');
566
        }
567
        }
567
    }
568
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt (-1 / +1 lines)
Lines 305-311 Link Here
305
            });
305
            });
306
306
307
            $("#useadvanced").click(function(){
307
            $("#useadvanced").click(function(){
308
                Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "advanced", { expires: 365, path: '/', sameSite: 'Lax' } );
308
                Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "advanced", { expires: 365, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' } );
309
                return true;
309
                return true;
310
            });
310
            });
311
311
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/cataloging-home.tt (-1 / +1 lines)
Lines 250-256 Link Here
250
        });
250
        });
251
251
252
        $("#useadvanced").click(function(){
252
        $("#useadvanced").click(function(){
253
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "advanced", { expires: 365, path: '/', sameSite: 'Lax' } );
253
            Cookies.set( "catalogue_editor_[% logged_in_user.borrowernumber | html %]", "advanced", { expires: 365, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' } );
254
            return true;
254
            return true;
255
        });
255
        });
256
    });
256
    });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs.tt (-1 / +1 lines)
Lines 243-249 Link Here
243
        function SearchToHold(club_id) {
243
        function SearchToHold(club_id) {
244
            var date = new Date();
244
            var date = new Date();
245
            date.setTime(date.getTime() + (10 * 60 * 1000));
245
            date.setTime(date.getTime() + (10 * 60 * 1000));
246
            Cookies.set("holdforclub", club_id, { path: "/", expires: date, sameSite: 'Lax'  });
246
            Cookies.set("holdforclub", club_id, { path: "/", expires: date, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
247
            location.href="/cgi-bin/koha/catalogue/search.pl";
247
            location.href="/cgi-bin/koha/catalogue/search.pl";
248
        }
248
        }
249
    </script>
249
    </script>
(-)a/koha-tmpl/intranet-tmpl/prog/js/acquisitions-menu.js (-1 / +1 lines)
Lines 3-9 function searchToOrder( basketno, vendorid ){ Link Here
3
    var cookieData = "";
3
    var cookieData = "";
4
    date.setTime(date.getTime() + (10 * 60 * 1000));
4
    date.setTime(date.getTime() + (10 * 60 * 1000));
5
    cookieData += basketno + "/" + vendorid;
5
    cookieData += basketno + "/" + vendorid;
6
    Cookies.set("searchToOrder", cookieData, { path: "/", expires: date, sameSite: 'Lax'  });
6
    Cookies.set("searchToOrder", cookieData, { path: "/", expires: date, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
7
}
7
}
8
8
9
$(document).ready(function() {
9
$(document).ready(function() {
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-1 / +1 lines)
Lines 777-783 $(document).ready(function() { Link Here
777
        $('#issues-table-load-delay').hide();
777
        $('#issues-table-load-delay').hide();
778
    }
778
    }
779
    $('#issues-table-load-immediately').on( "change", function(){
779
    $('#issues-table-load-immediately').on( "change", function(){
780
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: 'Lax'  });
780
        Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
781
    });
781
    });
782
782
783
    // Don't load relatives' issues table unless it is clicked on
783
    // Don't load relatives' issues table unless it is clicked on
(-)a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js (-1 / +1 lines)
Lines 146-151 function export_barcodes() { Link Here
146
function searchToHold(){
146
function searchToHold(){
147
    var date = new Date();
147
    var date = new Date();
148
    date.setTime(date.getTime() + (10 * 60 * 1000));
148
    date.setTime(date.getTime() + (10 * 60 * 1000));
149
    Cookies.set("holdfor", borrowernumber, { path: "/", expires: date, sameSite: 'Lax'  });
149
    Cookies.set("holdfor", borrowernumber, { path: "/", expires: date, sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
150
    location.href="/cgi-bin/koha/catalogue/search.pl";
150
    location.href="/cgi-bin/koha/catalogue/search.pl";
151
}
151
}
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js (-4 / +4 lines)
Lines 52-61 function hideColumn(num) { Link Here
52
        if (!found) {
52
        if (!found) {
53
            valCookie.push(hide);
53
            valCookie.push(hide);
54
            var cookieString = valCookie.join("/");
54
            var cookieString = valCookie.join("/");
55
            Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: 'Lax'  });
55
            Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
56
        }
56
        }
57
    } else {
57
    } else {
58
        Cookies.set("showColumns", hide, { expires: date, path: '/', sameSite: 'Lax'  });
58
        Cookies.set("showColumns", hide, { expires: date, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]'  });
59
    }
59
    }
60
}
60
}
61
61
Lines 88-94 function showColumn(num) { Link Here
88
        }
88
        }
89
        if (found) {
89
        if (found) {
90
            var cookieString = valCookie.join("/");
90
            var cookieString = valCookie.join("/");
91
            Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: 'Lax'  });
91
            Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
92
        }
92
        }
93
    }
93
    }
94
}
94
}
Lines 113-119 function hideAllColumns() { Link Here
113
    $("#itemst td:nth-child("+nb_cols+"),#itemst tr th:nth-child("+nb_cols+")").nextAll().hide();
113
    $("#itemst td:nth-child("+nb_cols+"),#itemst tr th:nth-child("+nb_cols+")").nextAll().hide();
114
    $("#hideall").prop("checked", true).parent().addClass("selected");
114
    $("#hideall").prop("checked", true).parent().addClass("selected");
115
    var cookieString = allColumns.join("/");
115
    var cookieString = allColumns.join("/");
116
    Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: 'Lax'  });
116
    Cookies.set("showColumns", cookieString, { expires: date, path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]'  });
117
}
117
}
118
118
119
$(document).ready(function () {
119
$(document).ready(function () {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt (-4 / +4 lines)
Lines 519-536 $(document).ready(function() { Link Here
519
            }
519
            }
520
        });
520
        });
521
        form_serialized = $(this).serialize();
521
        form_serialized = $(this).serialize();
522
        Cookies.set("form_serialized", JSON.stringify( form_serialized ), { path: '/', sameSite: 'Lax' });
522
        Cookies.set("form_serialized", JSON.stringify( form_serialized ), { path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
523
        form_serialized_limits = [
523
        form_serialized_limits = [
524
            $('#language-limit').val(),   $('#branchloop').val(),
524
            $('#language-limit').val(),   $('#branchloop').val(),
525
            $('#subtype_audience').val(), $('#subtype_content').val(),
525
            $('#subtype_audience').val(), $('#subtype_content').val(),
526
            $('#subtype_format').val(),   $('#subtype_additional').val(),
526
            $('#subtype_format').val(),   $('#subtype_additional').val(),
527
            $('#locloop').val()
527
            $('#locloop').val()
528
        ];
528
        ];
529
        Cookies.set("form_serialized_limits", JSON.stringify( form_serialized_limits ),{ path: '/', sameSite: 'Lax' });
529
        Cookies.set("form_serialized_limits", JSON.stringify( form_serialized_limits ),{ path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
530
        [% IF ( expanded_options ) %]
530
        [% IF ( expanded_options ) %]
531
            Cookies.set("search_path_code", 'exs', { path: '/', sameSite: 'Lax' });
531
            Cookies.set("search_path_code", 'exs', { path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
532
        [% ELSE %]
532
        [% ELSE %]
533
            Cookies.set("search_path_code", 'ads', { path: '/', sameSite: 'Lax' });
533
            Cookies.set("search_path_code", 'ads', { path: '/', sameSite: '[% Koha.Preference('SameSiteSessionCookie') %]' });
534
        [% END %]
534
        [% END %]
535
    });
535
    });
536
536
(-)a/opac/sco/sco-main.pl (-2 / +2 lines)
Lines 383-390 $cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie( Link Here
383
    -expires => $jwt ? '+1d' : '',
383
    -expires => $jwt ? '+1d' : '',
384
    -HttpOnly => 1,
384
    -HttpOnly => 1,
385
    -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
385
    -secure => ( C4::Context->https_enabled() ? 1 : 0 ),
386
    -sameSite => 'Lax'
386
    -sameSite => C4::Context->preference('SameSiteSessionCookie')
387
));
387
));
388
388
$template->param(patronid => $patronid);
389
$template->param(patronid => $patronid);
389
390
390
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
391
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
391
- 

Return to bug 33259