cookie-0.4.0.1: HTTP cookie parsing and rendering

Safe Haskell | None

Web.Cookie

Contents

- Server to client
  - Data type
  - Functions
- Client to server
  - UTF8 Version
- Expires field

Synopsis

- data SetCookie
- setCookieName :: SetCookie -> ByteString
- setCookieValue :: SetCookie -> ByteString
- setCookiePath :: SetCookie -> Maybe ByteString
- setCookieExpires :: SetCookie -> Maybe UTCTime
- setCookieMaxAge :: SetCookie -> Maybe DiffTime
- setCookieDomain :: SetCookie -> Maybe ByteString
- setCookieHttpOnly :: SetCookie -> Bool
- setCookieSecure :: SetCookie -> Bool
- parseSetCookie :: ByteString -> SetCookie
- renderSetCookie :: SetCookie -> Builder
- def :: Default a => a
- type Cookies = [(ByteString, ByteString)]
- parseCookies :: ByteString -> Cookies
- renderCookies :: Cookies -> Builder
- type CookiesText = [(Text, Text)]
- parseCookiesText :: ByteString -> CookiesText
- renderCookiesText :: CookiesText -> Builder
- expiresFormat :: String
- formatCookieExpires :: UTCTime -> ByteString
- parseCookieExpires :: ByteString -> Maybe UTCTime

# Server to client

## Data type

data SetCookie Source

Instances

Eq SetCookie |
Show SetCookie |
Default SetCookie |

setCookieName :: SetCookie -> ByteString Source

setCookieValue :: SetCookie -> ByteString Source

setCookiePath :: SetCookie -> Maybe ByteString Source

setCookieExpires :: SetCookie -> Maybe UTCTime Source

setCookieMaxAge :: SetCookie -> Maybe DiffTime Source

setCookieDomain :: SetCookie -> Maybe ByteString Source

setCookieHttpOnly :: SetCookie -> Bool Source

setCookieSecure :: SetCookie -> Bool Source

## Functions

parseSetCookie :: ByteString -> SetCookie Source

renderSetCookie :: SetCookie -> Builder Source

def :: Default a => a

The default value for this type.

# Client to server

type Cookies = [(ByteString, ByteString)]Source

parseCookies :: ByteString -> Cookies Source

Decode the value of a "Cookie" request header into key/value pairs.

renderCookies :: Cookies -> Builder Source

## UTF8 Version

type CookiesText = [(Text, Text)]Source

Textual cookies. Functions assume UTF8 encoding.

parseCookiesText :: ByteString -> CookiesText Source

renderCookiesText :: CookiesText -> Builder Source

# Expires field

expiresFormat :: String Source

formatCookieExpires :: UTCTime -> ByteString Source

Format a `UTCTime` for a cookie.

parseCookieExpires :: ByteString -> Maybe UTCTime Source