Merge pull request #1258 from bitemyapp/master

What I did to avoid the duplicate cookie problem
This commit is contained in:
Maximilian Tagher 2016-08-13 21:18:49 -04:00 committed by GitHub
commit 9fb876e383
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