mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 23:12:22 +03:00
Update SetCookie docs.
This commit is contained in:
parent
500ce61585
commit
ebb4aa4b96
@ -6,9 +6,19 @@ module Server.SetCookie exposing
|
|||||||
, toString
|
, toString
|
||||||
)
|
)
|
||||||
|
|
||||||
{-| <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie>
|
{-| Server-rendered pages in your `elm-pages` can set cookies. `elm-pages` provides two high-level ways to work with cookies:
|
||||||
|
|
||||||
<https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies>
|
- [`Server.Session.withSession`](Server.Session#withSession)
|
||||||
|
- [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader)
|
||||||
|
|
||||||
|
[`Server.Session.withSession`](Server.Session#withSession) provides a high-level way to manage key-value pairs of data using cookie storage,
|
||||||
|
whereas `Server.Response.withSetCookieHeader` gives a more low-level tool for setting cookies. It's often best to use the
|
||||||
|
most high-level tool that will fit your use case.
|
||||||
|
|
||||||
|
You can learn more about the basics of cookies in the Web Platform in these helpful MDN documentation pages:
|
||||||
|
|
||||||
|
- <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie>
|
||||||
|
- <https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies>
|
||||||
|
|
||||||
@docs SetCookie
|
@docs SetCookie
|
||||||
|
|
||||||
@ -21,6 +31,9 @@ module Server.SetCookie exposing
|
|||||||
|
|
||||||
@docs withImmediateExpiration, makeVisibleToJavaScript, nonSecure, setCookie, withDomain, withExpiration, withMaxAge, withPath, withSameSite
|
@docs withImmediateExpiration, makeVisibleToJavaScript, nonSecure, setCookie, withDomain, withExpiration, withMaxAge, withPath, withSameSite
|
||||||
|
|
||||||
|
|
||||||
|
## Internal
|
||||||
|
|
||||||
@docs toString
|
@docs toString
|
||||||
|
|
||||||
-}
|
-}
|
||||||
@ -57,7 +70,11 @@ type SameSite
|
|||||||
| None
|
| None
|
||||||
|
|
||||||
|
|
||||||
{-| -}
|
{-| Usually you'll want to use [`Server.Response.withSetCookieHeader`](Server-Response#withSetCookieHeader) instead.
|
||||||
|
|
||||||
|
This is a low-level helper that's there in case you want it but most users will never need this.
|
||||||
|
|
||||||
|
-}
|
||||||
toString : SetCookie -> String
|
toString : SetCookie -> String
|
||||||
toString builder =
|
toString builder =
|
||||||
let
|
let
|
||||||
|
Loading…
Reference in New Issue
Block a user