Network.HTTP.Cookie

HTTP-4000.3.16: A library for client-side HTTP

Copyright | See LICENSE file
License | BSD
Maintainer | Ganesh Sittampalam <ganesh@earth.li>
Stability | experimental
Portability | non-portable (not tested)
Safe Haskell | Safe-Inferred
Language | Haskell98

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 #

`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

Instances details

Read Cookie # |
Instance details Defined in Network.HTTP.Cookie Methods readsPrec :: Int -> ReadS Cookie # readList :: ReadS [Cookie] # readPrec :: ReadPrec Cookie # readListPrec :: ReadPrec [Cookie] #
Show Cookie # |
Instance details Defined in Network.HTTP.Cookie Methods showsPrec :: Int -> Cookie -> ShowS # show :: Cookie -> String # showList :: [Cookie] -> ShowS #
Eq Cookie # |
Instance details Defined in Network.HTTP.Cookie Methods (==) :: Cookie -> Cookie -> Bool # (/=) :: Cookie -> Cookie -> Bool #

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

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

cookiesToHeader :: [Cookie] -> Header #

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

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

    processCookieHeaders dom hdrs