salvia-protocol-1.0.1: Salvia webserver protocol suite supporting URI, HTTP, Cookie and MIME.

Network.Protocol.Cookie

Contents

Description

For more information: http:www.ietf.orgrfcrfc2109.txt

Synopsis

Cookie datatype.

data Cookie Source

The Cookie data type containg one key/value pair with all the (potentially optional) meta-data.

Instances

empty :: CookieSource

Create an empty cookie.

cookie :: String :<->: CookieSource

Cookie parser and pretty printer as a lens. To be used in combination with the Cookie header field.

setCookie :: String :<->: CookieSource

Cookie parser and pretty printer as a lens. To be used in combination with the Set-Cookie header field.

Accessing cookies.

name :: Cookie :-> StringSource

Access name/key of a cookie.

value :: Cookie :-> StringSource

Access value of a cookie.

comment :: Cookie :-> Maybe StringSource

Access comment of a cookie.

commentURL :: Cookie :-> Maybe StringSource

Access comment-URL of a cookie.

discard :: Cookie :-> BoolSource

Access discard flag of a cookie.

domain :: Cookie :-> Maybe StringSource

Access domain of a cookie.

maxAge :: Cookie :-> Maybe IntSource

Access max-age of a cookie.

expires :: Cookie :-> Maybe StringSource

Access expiration of a cookie.

path :: Cookie :-> Maybe StringSource

Access path of a cookie.

port :: Cookie :-> [Int]Source

Access port of a cookie.

secure :: Cookie :-> BoolSource

Access secure flag of a cookie.

version :: Cookie :-> IntSource

Access version of a cookie.

Collection of cookies.

data Cookies Source

A collection of multiple cookies. These can all be set in one single HTTP Set-Cookie header field.

Instances

unCookies :: Cookies :-> Map String CookieSource

Access raw cookie mapping from collection.

cookies :: String :<->: CookiesSource

Label for printing and parsing collections of cookies.

setCookies :: String :<->: CookiesSource

Cookies parser and pretty printer as a lens.

pickCookie :: String -> Cookies :-> Maybe CookieSource

Case-insensitive way of getting a cookie out of a collection by name.

fromList :: [Cookie] -> CookiesSource

Convert a list to a cookies collection.

toList :: Cookies -> [Cookie]Source

Get the cookies as a list.