web-cookiejar
Safe HaskellNone
LanguageHaskell2010

Web.Cookie.Jar

Description

Parser for a Netscape/Mozilla cookie jar

Provides parsing functions that parse the Netscape/Mozilla cookie jar file format, along wiht Builders that provide an incomplete roundtrip with the parser.

The roundtrip is incomplete because some of the fields in Cookie are not saved in the Netscape/Mozilla cookie jar; see cookieBuilder.

Synopsis

read/write Cookie Jar files

writeJar :: FilePath -> CookieJar -> IO () Source #

Writes a cookie jar to the given path in the Netscape/Mozilla format, with no header

writeJar' :: Builder -> FilePath -> CookieJar -> IO () Source #

Like writeJar, but outputs a header before the cookie lines

writeNetscapeJar :: FilePath -> CookieJar -> IO () Source #

Like writeJar, but outputs the Netscape header before the cookie lines

readJar :: FilePath -> IO (Either String CookieJar) Source #

Read a Cookie Jar from a file.

Cookie jar format

parsing

cookieJarParser :: Parser CookieJar Source #

Parser for a cookie jar in the Netscape/Mozilla format

cookieParser :: Parser Cookie Source #

Parser for one cookieline in a cookie jar in the NetscapeMozilla format This will also consume any comment lines preceding the cookie line.

This parser recognizes the magic prefix and sets the appropriate field in the Cookie@ datatype

parseCookieJar :: ByteString -> Either String CookieJar Source #

Parse a ByteString containing a cookie jar in the Netscape/Mozilla format

printing

netscapeJarBuilder :: CookieJar -> Builder Source #

Like jarBuilder but outputs the Netscape header before the cookie lines

jarBuilder :: CookieJar -> Builder Source #

Print a cookie jar in the Netscape/Mozilla format, with no header

jarBuilder' :: Builder -> CookieJar -> Builder Source #

Like jarBuilder but outputs a header before the cookie lines

cookieBuilder :: Cookie -> Builder Source #

Builder for one cookie; generates a single line in the Cookie Jar file format

the values of the following fields are not output, as the file format does support them.

  • cookie_creation_time
  • cookie_last_access_time
  • cookie_persistent

re-exports

parseOnly :: Parser a -> ByteString -> Either String a #