SetCookie package:scotty

Data type representing the key-value pair to use for a cookie, as well as configuration options for it.

Creating a SetCookie

SetCookie does not export a constructor; instead, use defaultSetCookie and override values (see http://www.yesodweb.com/book/settings-types for details):
import Web.Cookie
:set -XOverloadedStrings
let cookie = defaultSetCookie { setCookieName = "cookieName", setCookieValue = "cookieValue" }

Cookie Configuration

Cookies have several configuration options; a brief summary of each option is given below. For more information, see RFC 6265 or Wikipedia.
Set a cookie, with full access to its options (see SetCookie)
The domain for which the cookie should be sent. Default value: Nothing (The browser defaults to the current domain).
The time at which to expire the cookie. Default value: Nothing (The browser will default to expiring a cookie when the browser is closed).
Marks the cookie as "HTTP only", i.e. not accessible from Javascript. Default value: False
The maximum time to keep the cookie, in seconds. Default value: Nothing (The browser defaults to expiring a cookie when the browser is closed).
The name of the cookie. Default value: "name"
The URL path for which the cookie should be sent. Default value: Nothing (The browser defaults to the path of the request that sets the cookie).
The "same site" policy of the cookie, i.e. whether it should be sent with cross-site requests. Default value: Nothing
Instructs the browser to only send the cookie over HTTPS. Default value: False
The value of the cookie. Default value: "value"
A minimal SetCookie. All fields are Nothing or False except setCookieName = "name" and setCookieValue = "value". You need this to construct a SetCookie, because it does not export a constructor. Equivalently, you may use def.