anchor.diff:          AuthSession = couch_util:decodeBase64Url(Cookie),
           [User, TimeStr | HashParts] = string:tokens(?b2l(AuthSession), ":"),
           % Verify expiry and hash
  -        case couch_config:get("chttpd_auth", "secret") of
  +        case couch_config:get("couch_httpd_auth", "secret") of
           undefined ->
               ?LOG_DEBUG("AuthSession cookie, but no secret in config!", []),
               {cookie_auth_failed, {internal_server_error, null}};
  
positive.code:                 true ->
                      TimeStamp = erlang:list_to_integer(TimeStr, 16),
                      Timeout = erlang:list_to_integer(couch_config:get(
                          "chttpd_auth", "timeout", "600")),
                      CurrentTime = timestamp(),
                      if CurrentTime < TimeStamp + Timeout ->
                          TimeLeft = TimeStamp + Timeout - CurrentTime,
  
negative.code:     SessionData = ?b2l(User) ++ ":" ++ erlang:integer_to_list(TimeStamp, 16),
      Hash = crypto:sha_mac(Secret, SessionData),
      Cookie = couch_util:encodeBase64Url(SessionData ++ ":" ++ ?b2l(Hash)),
      % TODO add {secure, true} to options when SSL is detected
      mochiweb_cookies:cookie("AuthSession", Cookie, [{path, "/"}]).
  
  hash_password(Password, Salt) ->
      ?l2b(couch_util:to_hex(crypto:sha(<<Password/binary, Salt/binary>>))).
  