samesite session

This commit is contained in:
byte[] 2019-12-23 19:20:24 -05:00
parent 20c521e67b
commit b2724c0de8
2 changed files with 2 additions and 1 deletions

View file

@ -40,6 +40,7 @@ defmodule PhilomenaWeb.Endpoint do
# Set :encryption_salt if you would also like to encrypt it. # Set :encryption_salt if you would also like to encrypt it.
plug Plug.Session, plug Plug.Session,
store: :cookie, store: :cookie,
extra: "SameSite=Lax",
key: "_philomena_key", key: "_philomena_key",
signing_salt: "signed cookie", signing_salt: "signed cookie",
encryption_salt: "authenticated encrypted cookie" encryption_salt: "authenticated encrypted cookie"

View file

@ -15,7 +15,7 @@ defmodule PhilomenaWeb.ContentSecurityPolicyPlug do
end end
def call(conn, [csp_value: csp_value]) do def call(conn, [csp_value: csp_value]) do
Conn.put_resp_header(conn, "Content-Security-Policy", csp_value) Conn.put_resp_header(conn, "content-security-policy", csp_value)
end end
defp cdn_uri, do: Application.get_env(:philomena, :cdn_host) |> to_uri() defp cdn_uri, do: Application.get_env(:philomena, :cdn_host) |> to_uri()