HTTP-4000.2.8: A library for client-side HTTP

Portability | non-portable (not tested)
Stability | experimental
Maintainer | Ganesh Sittampalam <http@projects.haskell.org>
Safe Haskell | Safe-Inferred

Network.HTTP.Cookie

Description

This module provides the data types and functions for working with HTTP cookies. Right now, it contains mostly functionality needed by `Browser`.

Synopsis

- data Cookie = MkCookie {
  - ckDomain :: String
  - ckName :: String
  - ckValue :: String
  - ckPath :: Maybe String
  - ckComment :: Maybe String
  - ckVersion :: Maybe String
  }
- cookieMatch :: (String, String) -> Cookie -> Bool
- cookiesToHeader :: [Cookie] -> Header
- processCookieHeaders :: String -> [Header] -> ([String], [Cookie])

# Documentation

data Cookie Source

`Cookie` is the Haskell representation of HTTP cookie values. See its relevant specs for authoritative details.

Constructors

MkCookie |
Fields ckDomain :: String ckName :: String ckValue :: String ckPath :: Maybe String ckComment :: Maybe String ckVersion :: Maybe String

Instances

Eq Cookie |
Read Cookie |
Show Cookie |

cookieMatch :: (String, String) -> Cookie -> Bool Source

`cookieMatch (domain,path) ck` performs the standard cookie match wrt the given domain and path.

cookiesToHeader :: [Cookie] -> Header Source

`cookieToHeaders ck` serialises `Cookie`s to an HTTP request header.

processCookieHeaders :: String -> [Header] -> ([String], [Cookie])Source

    processCookieHeaders dom hdrs