anchor.diff:                  throw({bad_request, Reason})
           end,
           % Verify expiry and hash
  -        {NowMS, NowS, _} = erlang:now(),
  -        CurrentTime = NowMS * 1000000 + NowS,
  +        CurrentTime = make_cookie_time(),
           case couch_config:get("couch_httpd_auth", "secret", nil) of
           nil -> 
               ?LOG_ERROR("cookie auth secret is not set",[]),
  
positive.code:     Cookies = mochiweb_cookies:parse_cookie(CookieHeader),
      AuthSession = proplists:get_value("AuthSession", Cookies),
      if AuthSession == undefined ->
          {NowMS, NowS, _} = erlang:now(),
          TimeStamp = NowMS * 1000000 + NowS,
          [cookie_auth_cookie(?b2l(User), Secret, TimeStamp)];
      true ->
          []
  
negative.code:         true ->
              % setup the session cookie
              Secret = ?l2b(ensure_cookie_auth_secret()),
              CurrentTime = make_cookie_time(),
              Cookie = cookie_auth_cookie(?b2l(UserName), <<Secret/binary, UserSalt/binary>>, CurrentTime),
              % TODO document the "next" feature in Futon
              {Code, Headers} = case couch_httpd:qs_value(Req, "next", nil) of
  