mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-24 04:27:59 +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';
|
fingerprint = 'c1836832948';
|
||||||
}
|
}
|
||||||
|
|
||||||
document.cookie = `_ses=${fingerprint}; path=/`;
|
document.cookie = `_ses=${fingerprint}; path=/; SameSite=Lax`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { setFingerprintCookie };
|
export { setFingerprintCookie };
|
||||||
|
|
|
@ -20,6 +20,6 @@ defmodule PhilomenaWeb.Channel.NsfwController do
|
||||||
# Duplicated from setting controller
|
# Duplicated from setting controller
|
||||||
defp set_cookie(conn, cookie_name, value) do
|
defp set_cookie(conn, cookie_name, value) do
|
||||||
# JS wants access; max-age is set to 25 years from now
|
# 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
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,7 +48,8 @@ defmodule PhilomenaWeb.SettingController do
|
||||||
# JS wants access; max-age is set to 25 years from now
|
# 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"),
|
Conn.put_resp_cookie(conn, cookie_name, to_string(params[param_name] == "true"),
|
||||||
max_age: 788_923_800,
|
max_age: 788_923_800,
|
||||||
http_only: false
|
http_only: false,
|
||||||
|
extra: "SameSite=Lax"
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue