Fix an issue where disabling _cacheAuthToken causes cookies to break
Fix an issue where disabling _cacheAuthToken causes cookies to break

Prior to this commit, this was the flow of cookie-enabled endpoints:

- Request to a cookie-enabled endpoint is initialized
-- getCurrentToken(allowCookie=True) is called, caching the token value
-- Subsequent calls to getCurrentUser call allowCookie=False but still
obtain the token value cached from when allowCookie=True.

This is due to a bug where _cacheAuthToken caches the token regardless
of the value of allowCookie.

In other words, access.cookie just happened to be working because the
very first call to getCurrentToken has the correct allowCookie=True
value, and the bug in our memoization causes it to always remember the
token from when allowCookie=True.

This commit defines a request-local variable named girderAllowCookie
when cookie access is allowed. If the user doesn't pass anything to
getCurrentToken then it defaults to this value. This allows the user
to explicitly override the call but also lets default calls to
getCurrentToken (like the one performed in getCurrentUser) to
correctly use a cookie if the request is meant to.

The memoization bug still exists, but will be fixed in future commits with
the implementation of dogpile.

data-exp-lab/girder,jbeezley/girder,girder/girder,kotfic/girder,data-exp-lab/girder,girder/girder,Xarthisius/girder,manthey/girder,Xarthisius/girder,data-exp-lab/girder,Kitware/girder,Kitware/girder,jbeezley/girder,kotfic/girder,Kitware/girder,RafaelPalomar/girder,kotfic/girder,data-exp-lab/girder,RafaelPalomar/girder,manthey/girder,Xarthisius/girder,manthey/girder,RafaelPalomar/girder,kotfic/girder,data-exp-lab/girder,Kitware/girder,RafaelPalomar/girder,manthey/girder,jbeezley/girder,girder/girder,girder/girder,RafaelPalomar/girder,Xarthisius/girder,Xarthisius/girder,jbeezley/girder,kotfic/girder