anchor.diff:                  ]});
           _Else ->
               % clear the session
  -            Cookie = mochiweb_cookies:cookie("AuthSession", "", [{path, "/"}, cookie_scheme(Req)]),
  +            Cookie = mochiweb_cookies:cookie("AuthSession", "", [{path, "/"}] ++ cookie_scheme(Req)),
               send_json(Req, 401, [Cookie], {[{error, <<"unauthorized">>},{reason, <<"Name or password is incorrect.">>}]})
       end;
   % get user info
  
positive.code:     NowMS * 1000000 + NowS.
  
  cookie_scheme(#httpd{mochi_req=MochiReq}) ->
      case MochiReq:get(scheme) of
          http -> {http_only, true};
          https -> {secure, true}
      end.
  
negative.code:     Hash = crypto:sha_mac(Secret, SessionData),
      mochiweb_cookies:cookie("AuthSession",
          couch_util:encodeBase64Url(SessionData ++ ":" ++ ?b2l(Hash)),
          [{path, "/"}] ++ cookie_scheme(Req)).
  
  hash_password(Password, Salt) ->
      ?l2b(couch_util:to_hex(crypto:sha(<<Password/binary, Salt/binary>>))).
  