retrieveSession :: Request -> ConnectionM (Request, Maybe Session)