diff --git a/simple-session.cabal b/simple-session.cabal
--- a/simple-session.cabal
+++ b/simple-session.cabal
@@ -1,5 +1,5 @@
 name:                simple-session
-version:             0.8.0.1
+version:             0.8.1.0
 synopsis:            Cookie-based session management for the Simple web framework
 description:
 
@@ -49,9 +49,9 @@
     , bytestring
     , containers
     , http-types
-    , simple >= 0.8.0 && < 0.9
+    , simple >= 0.8.1 && < 0.9
     , transformers
-    , wai >= 2.0
+    , wai >= 2.1
   default-language:    Haskell2010
 
 source-repository head
diff --git a/src/Web/Simple/Session.hs b/src/Web/Simple/Session.hs
--- a/src/Web/Simple/Session.hs
+++ b/src/Web/Simple/Session.hs
@@ -100,11 +100,11 @@
             => Controller hs a -> Controller hs a
 withSession (ControllerT act) = do
   sk <- sessionKey
-  ControllerT $ \st0 -> do
-    (eres, st@(r, _)) <- act st0
+  ControllerT $ \st0 req -> do
+    (eres, st) <- act st0 req
     case eres of
       Left resp0 -> do
-        let resp = case getSession r of
+        let resp = case getSession st of
                      Just sess -> addCookie
                                    ("session", dumpSession sk sess)
                                    resp0
