Skip to content

Instantly share code, notes, and snippets.

@scan
Created April 4, 2012 20:02
Show Gist options
  • Save scan/2305168 to your computer and use it in GitHub Desktop.
Save scan/2305168 to your computer and use it in GitHub Desktop.
getSid = do
msid <- optional $ lookCookieValue "ponysession"
case msid of
Nothing -> do
sid <- genSessionId
addCookie Session $ mkCookie "ponysession" $ B.unpack sid
return sid
Just sid -> return $ B.pack sid
{-
No instance for (FilterMonad Response m0)
arising from a use of `addCookie'
Possible fix:
add an instance declaration for (FilterMonad Response m0)
In the expression: addCookie Session
In a stmt of a 'do' block:
addCookie Session $ mkCookie "ponysession" $ B.unpack sid
In the expression:
do { sid <- genSessionId;
addCookie Session $ mkCookie "ponysession" $ B.unpack sid;
return sid }
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment