Refactor AuthenticationCookieManager.