Module
Biscotti.Cookie
- Package
- purescript-biscotti-cookie
- Repository
- drewolson/purescript-biscotti-cookie
This module allows parsing and generating cookie headers. You'll generally use
the Cookie.new
function to create a cookie from a name/value pair and the
Cookie.set*
functions to set attributes on a cookie.
Cookie.stringify
generates the string representation of a cookie, suitable for
writing to an HTTP header.
Cookie.parse
parses the string representation of a cookie, returning an
Either ParseError Cookie
.
import Biscotti.Cookie as Cookie
> Cookie.stringify $ Cookie.setSecure $ Cookie.new "key" "value"
key=value; Secure
> Cookie.parse "key=value; Secure"
(Right { name: "key", value: "value", secure: true, ... })
Re-exports from Biscotti.Cookie.Generator
Re-exports from Biscotti.Cookie.Parser
#parse Source
parse :: String -> Either ParseError Cookie
Parses a String
into an Either ParseError Cookie
.
> Parser.parse "key=value; Secure"
(Right { name: "key", value: "value", secure: true, ... })
Re-exports from Biscotti.Cookie.Types
#setHttpOnly Source
setHttpOnly :: Cookie -> Cookie
#getHttpOnly Source
getHttpOnly :: Cookie -> Boolean