anchor.diff:              % 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),
  +            Cookie = cookie_auth_cookie(Req, ?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
                   nil ->
  
positive.code: make_cookie_time() ->
      {NowMS, NowS, _} = erlang:now(),
      NowMS * 1000000 + NowS.
  
negative.code:     end.
  
  cookie_auth_header(#httpd{user_ctx=#user_ctx{name=null}}, _Headers) -> [];
  cookie_auth_header(#httpd{user_ctx=#user_ctx{name=User}, auth={Secret, true}}=Req, Headers) ->
      % Note: we only set the AuthSession cookie if:
      %  * a valid AuthSession cookie has been received
      %  * we are outside a 10% timeout window
  