context.authTokenCookie = new AuthToken(context.authAccount).getEncoded();
context.authTokenCookie = new AuthToken(context.authAccount, isAdminRequest).getEncoded();
    private void getAccount(Context context) throws IOException, ServletException {        try {            int adminPort = Provisioning.getInstance().getLocalServer().getIntAttr(Provisioning.A_zimbraAdminPort, -1);            boolean isAdminRequest = (context.req.getLocalPort() == adminPort);            // check cookie first            if (context.cookieAuthAllowed()) {                context.authAccount = cookieAuthRequest(context.req, context.resp, true);                if (context.authAccount != null) {                    context.cookieAuthHappened = true;                    try {                        AuthToken at = isAdminRequest ? getAdminAuthTokenFromCookie(context.req, context.resp, true) : getAuthTokenFromCookie(context.req, context.resp, true);                        context.authTokenCookie = at.getEncoded();                    } catch (AuthTokenException e) {                    }                    return;                }            }            // fallback to basic auth            if (context.basicAuthAllowed()) {                context.authAccount = basicAuthRequest(context.req, context.resp, false);                if (context.authAccount != null) {                    context.basicAuthHappened = true;                    // send cookie back if need be.                     if (!context.noSetCookie()) {                        try {                            context.authTokenCookie = new AuthToken(context.authAccount).getEncoded();                            context.resp.addCookie(new Cookie(isAdminRequest ? COOKIE_ZM_ADMIN_AUTH_TOKEN : COOKIE_ZM_AUTH_TOKEN, context.authTokenCookie));                        } catch (AuthTokenException e) {                        }                    }                }                // always return                return;            }            // there is no credential at this point.  assume anonymous public access and continue.        } catch (ServiceException e) {            throw new ServletException(e);        }    }