mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-23 20:18:00 +01:00
set samesite attribute to lax on all cookies to fix warnings
This commit is contained in:
parent
781eda345c
commit
7b36f99c09
3 changed files with 4 additions and 3 deletions
|
@ -45,7 +45,7 @@ function setFingerprintCookie() {
|
|||
fingerprint = 'c1836832948';
|
||||
}
|
||||
|
||||
document.cookie = `_ses=${fingerprint}; path=/`;
|
||||
document.cookie = `_ses=${fingerprint}; path=/; SameSite=Lax`;
|
||||
}
|
||||
|
||||
export { setFingerprintCookie };
|
||||
|
|
|
@ -20,6 +20,6 @@ defmodule PhilomenaWeb.Channel.NsfwController do
|
|||
# Duplicated from setting controller
|
||||
defp set_cookie(conn, cookie_name, value) do
|
||||
# JS wants access; max-age is set to 25 years from now
|
||||
Conn.put_resp_cookie(conn, cookie_name, value, max_age: 788_923_800, http_only: false)
|
||||
Conn.put_resp_cookie(conn, cookie_name, value, max_age: 788_923_800, http_only: false, extra: "SameSite=Lax")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -48,7 +48,8 @@ defmodule PhilomenaWeb.SettingController do
|
|||
# JS wants access; max-age is set to 25 years from now
|
||||
Conn.put_resp_cookie(conn, cookie_name, to_string(params[param_name] == "true"),
|
||||
max_age: 788_923_800,
|
||||
http_only: false
|
||||
http_only: false,
|
||||
extra: "SameSite=Lax"
|
||||
)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue