anchor.diff:      Cookies = mochiweb_cookies:parse_cookie(CookieHeader),
       AuthSession = proplists:get_value("AuthSession", Cookies),
       if AuthSession == undefined ->
  -        {NowMS, NowS, _} = erlang:now(),
  -        TimeStamp = NowMS * 1000000 + NowS,
  +        TimeStamp = make_cookie_time(),
           [cookie_auth_cookie(?b2l(User), Secret, TimeStamp)];
       true ->
           []
  
positive.code:                 throw({bad_request, Reason})
          end,
          % Verify expiry and hash
          {NowMS, NowS, _} = erlang:now(),
          CurrentTime = NowMS * 1000000 + NowS,
          case couch_config:get("couch_httpd_auth", "secret", nil) of
          nil -> 
              ?LOG_ERROR("cookie auth secret is not set",[]),
  
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
  