-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | HTTP cookie parsing and rendering
--   
--   HTTP cookie parsing and rendering
@package cookie
@version 0.4.1.6

module Web.Cookie

-- | Data type representing the key-value pair to use for a cookie, as well
--   as configuration options for it.
--   
--   <h4>Creating a SetCookie </h4>
--   
--   <a>SetCookie</a> does not export a constructor; instead, use the
--   <a>Default</a> instance to create one and override values (see
--   <a>http://www.yesodweb.com/book/settings-types</a> for details):
--   
--   <pre>
--   import Web.Cookie
--   :set -XOverloadedStrings
--   let cookie = <a>def</a> { <a>setCookieName</a> = "cookieName", <a>setCookieValue</a> = "cookieValue" }
--   </pre>
--   
--   <h4>Cookie Configuration</h4>
--   
--   Cookies have several configuration options; a brief summary of each
--   option is given below. For more information, see <a>RFC 6265</a> or
--   <a>Wikipedia</a>.
data SetCookie

-- | The name of the cookie. Default value: <tt>"name"</tt>
setCookieName :: SetCookie -> ByteString

-- | The value of the cookie. Default value: <tt>"value"</tt>
setCookieValue :: SetCookie -> ByteString

-- | The URL path for which the cookie should be sent. Default value:
--   <tt>Nothing</tt> (The browser defaults to the path of the request that
--   sets the cookie).
setCookiePath :: SetCookie -> Maybe ByteString

-- | The time at which to expire the cookie. Default value:
--   <tt>Nothing</tt> (The browser will default to expiring a cookie when
--   the browser is closed).
setCookieExpires :: SetCookie -> Maybe UTCTime

-- | The maximum time to keep the cookie, in seconds. Default value:
--   <tt>Nothing</tt> (The browser defaults to expiring a cookie when the
--   browser is closed).
setCookieMaxAge :: SetCookie -> Maybe DiffTime

-- | The domain for which the cookie should be sent. Default value:
--   <tt>Nothing</tt> (The browser defaults to the current domain).
setCookieDomain :: SetCookie -> Maybe ByteString

-- | Marks the cookie as "HTTP only", i.e. not accessible from Javascript.
--   Default value: <tt>False</tt>
setCookieHttpOnly :: SetCookie -> Bool

-- | Instructs the browser to only send the cookie over HTTPS. Default
--   value: <tt>False</tt>
setCookieSecure :: SetCookie -> Bool
parseSetCookie :: ByteString -> SetCookie
renderSetCookie :: SetCookie -> Builder

-- | The default value for this type.
def :: Default a => a
type Cookies = [(ByteString, ByteString)]

-- | Decode the value of a "Cookie" request header into key/value pairs.
parseCookies :: ByteString -> Cookies
renderCookies :: Cookies -> Builder

-- | Textual cookies. Functions assume UTF8 encoding.
type CookiesText = [(Text, Text)]
parseCookiesText :: ByteString -> CookiesText
renderCookiesText :: CookiesText -> Builder
expiresFormat :: String

-- | Format a <a>UTCTime</a> for a cookie.
formatCookieExpires :: UTCTime -> ByteString
parseCookieExpires :: ByteString -> Maybe UTCTime
instance GHC.Show.Show Web.Cookie.SetCookie
instance GHC.Classes.Eq Web.Cookie.SetCookie
instance Control.DeepSeq.NFData Web.Cookie.SetCookie
instance Data.Default.Class.Default Web.Cookie.SetCookie
