-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | HTTP cookie parsing and rendering -- -- Hackage documentation generation is not reliable. For up to date -- documentation, please see: -- https://www.stackage.org/package/cookie. @package cookie @version 0.4.2 module Web.Cookie -- | 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 the -- Default instance to create one and override values (see -- http://www.yesodweb.com/book/settings-types for details): -- --
--   import Web.Cookie
--   :set -XOverloadedStrings
--   let cookie = def { 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. data SetCookie -- | The name of the cookie. Default value: "name" setCookieName :: SetCookie -> ByteString -- | The value of the cookie. Default value: "value" setCookieValue :: SetCookie -> ByteString -- | 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). setCookiePath :: SetCookie -> Maybe ByteString -- | The time at which to expire the cookie. Default value: -- Nothing (The browser will default to expiring a cookie when -- the browser is closed). setCookieExpires :: SetCookie -> Maybe UTCTime -- | The maximum time to keep the cookie, in seconds. Default value: -- Nothing (The browser defaults to expiring a cookie when the -- browser is closed). setCookieMaxAge :: SetCookie -> Maybe DiffTime -- | The domain for which the cookie should be sent. Default value: -- Nothing (The browser defaults to the current domain). setCookieDomain :: SetCookie -> Maybe ByteString -- | Marks the cookie as "HTTP only", i.e. not accessible from Javascript. -- Default value: False setCookieHttpOnly :: SetCookie -> Bool -- | Instructs the browser to only send the cookie over HTTPS. Default -- value: False setCookieSecure :: SetCookie -> Bool -- | Marks the cookie as "same site", i.e. should not be sent with -- cross-site requests. Default value: Nothing setCookieSameSite :: SetCookie -> Maybe SameSiteOption -- | Data type representing the options for a SameSite cookie data SameSiteOption sameSiteLax :: SameSiteOption sameSiteStrict :: SameSiteOption parseSetCookie :: ByteString -> SetCookie renderSetCookie :: SetCookie -> Builder -- | The default value for this type. def :: Default a => a type Cookies = [(ByteString, ByteString)] -- | Decode the value of a "Cookie" request header into key/value pairs. parseCookies :: ByteString -> Cookies renderCookies :: Cookies -> Builder -- | Textual cookies. Functions assume UTF8 encoding. type CookiesText = [(Text, Text)] parseCookiesText :: ByteString -> CookiesText renderCookiesText :: CookiesText -> Builder expiresFormat :: String -- | Format a UTCTime for a cookie. formatCookieExpires :: UTCTime -> ByteString parseCookieExpires :: ByteString -> Maybe UTCTime instance GHC.Show.Show Web.Cookie.SetCookie instance GHC.Classes.Eq Web.Cookie.SetCookie instance GHC.Classes.Eq Web.Cookie.SameSiteOption instance GHC.Show.Show Web.Cookie.SameSiteOption instance Control.DeepSeq.NFData Web.Cookie.SameSiteOption instance Control.DeepSeq.NFData Web.Cookie.SetCookie instance Data.Default.Class.Default Web.Cookie.SetCookie