-- 5.1.1.
timeParseTest valid n xs = sessionTest ("Time parsing: " ++ xs) $ do
  recv (time $ n - 1) e $ cs ++ "; Expires=" ++ xs
  send (time $ n - 1) e cs
  if valid
    then noSend (time n) e
    -- An invalid date doesn't invalidate the whole-cookie, so it becomes
    -- a non-persistent cookie with no particular expiration.
    else send (time n) e cs >> send (time $ n + year) e cs
  where
    cs = "x=y"
    e = ep host1 path1 True True
timeParseTest valid n xs = sessionTest ("Time parsing: " ++ xs) $ do
  recv (time $ n - 1) e $ cs ++ "; Expires=" ++ xs
  send (time $ n - 1) e cs
  if valid
    then noSend (time n) e
    -- An invalid date doesn't invalidate the whole-cookie, so it becomes
    -- a non-persistent cookie with no particular expiration.
    else send (time n) e cs >> send (time $ n + year) e cs
  where
    cs = "x=y"
    e = ep host1 path1 True True
timeParseTest valid n xs = sessionTest ("Time parsing: " ++ xs) $ do
  recv (time $ n - 1) e $ cs ++ "; Expires=" ++ xs
  send (time $ n - 1) e cs
  if valid
    then noSend (time n) e
    -- An invalid date doesn't invalidate the whole-cookie, so it becomes
    -- a non-persistent cookie with no particular expiration.
    else send (time n) e cs >> send (time $ n + year) e cs
  where
    cs = "x=y"
    e = ep host1 path1 True True