Merge branch 'master' of github.com:yesodweb/yesod

This commit is contained in:
Michael Snoyman 2016-08-14 15:43:55 +03:00
commit 10b8ee70e7
2 changed files with 6 additions and 2 deletions

View File

@ -724,7 +724,11 @@ invalidArgsI msg = do
-- | Set the cookie on the client. -- | Set the cookie on the client.
setCookie :: MonadHandler m => SetCookie -> m () setCookie :: MonadHandler m => SetCookie -> m ()
setCookie = addHeaderInternal . AddCookie setCookie sc = do
addHeaderInternal (DeleteCookie name path)
addHeaderInternal (AddCookie sc)
where name = setCookieName sc
path = maybe "/" id (setCookiePath sc)
-- | Helper function for setCookieExpires value -- | Helper function for setCookieExpires value
getExpires :: MonadIO m getExpires :: MonadIO m

View File

@ -323,7 +323,7 @@ instance NFData ErrorResponse where
----- header stuff ----- header stuff
-- | Headers to be added to a 'Result'. -- | Headers to be added to a 'Result'.
data Header = data Header =
AddCookie SetCookie AddCookie SetCookie
| DeleteCookie ByteString ByteString | DeleteCookie ByteString ByteString
| Header ByteString ByteString | Header ByteString ByteString
deriving (Eq, Show) deriving (Eq, Show)