happstack-server-0.5.0.3: Web related tools and services.

Happstack.Server.Cookie

Synopsis

Documentation

mkCookie :: String -> String -> CookieSource

Creates a cookie with a default version of 1 and path of /

mkCookieHeader :: Seconds -> Cookie -> StringSource

Set a Cookie in the Result. The values are escaped as per RFC 2109, but some browsers may have buggy support for cookies containing e.g. '"' or ' '.

Also, it seems that chrome, safari, and other webkit browsers do not like cookies which have double quotes around the domain and reject/ignore the cookie. So, we no longer quote the domain.

getCookies :: Monad m => ByteString -> m [Cookie]Source

Get all cookies from the HTTP request. The cookies are ordered per RFC from the most specific to the least specific. Multiple cookies with the same name are allowed to exist.

getCookie :: Monad m => String -> ByteString -> m CookieSource

Get the most specific cookie with the given name. Fails if there is no such cookie or if the browser did not escape cookies in a proper fashion. Browser support for escaping cookies properly is very diverse.

parseCookies :: String -> Either String [Cookie]Source

Not an supported api. Takes a cookie header and returns either a String error message or an array of parsed cookies

cookiesParser :: GenParser Char st [Cookie]Source

not a supported api. A parser for RFC 2109 cookies