dillonkearns/elm-pages-v3-beta/2.0.0

NOTE: the latest version is 21.0.0

Server.SetCookie

type alias SetCookie =
{ name : String
, value : String
, expiration : Maybe Posix
, httpOnly : Bool
, maxAge : Maybe Int
, path : Maybe String
, domain : Maybe String
, secure : Bool
, sameSite : Maybe SameSite
}
= Strict
| Lax
| None
withImmediateExpiration : SetCookie -> SetCookie
httpOnly : SetCookie -> SetCookie
nonSecure : SetCookie -> SetCookie

Secure (only sent over https, or localhost on http) is the default. This overrides that and removes the Secure attribute from the cookie.

setCookie : String -> String -> SetCookie
withDomain : String -> SetCookie -> SetCookie
withExpiration : Posix -> SetCookie -> SetCookie
withMaxAge : Int -> SetCookie -> SetCookie
withPath : String -> SetCookie -> SetCookie
withSameSite : SameSite -> SetCookie -> SetCookie

The default SameSite policy is Lax if one is not explicitly set. See the SameSite section in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#attributes.

toString : SetCookie -> String