Search in sources :

Example 1 with CookieData

use of lucee.runtime.listener.CookieData in project Lucee by lucee.

the class Cookie method doStartTag.

@Override
public int doStartTag() throws PageException {
    Key key = KeyImpl.getInstance(name);
    String appName = Login.getApplicationName(pageContext.getApplicationContext());
    boolean isAppName = false;
    if (KeyConstants._CFID.equalsIgnoreCase(key) || KeyConstants._CFTOKEN.equalsIgnoreCase(key) || (isAppName = key.equals(appName))) {
        ApplicationContext ac = pageContext.getApplicationContext();
        if (ac instanceof ApplicationContextSupport) {
            ApplicationContextSupport acs = (ApplicationContextSupport) ac;
            CookieData data = isAppName ? acs.getAuthCookie() : acs.getSessionCookie();
            if (data != null && data.isDisableUpdate())
                throw new ExpressionException("customize " + key + " is disabled!");
        }
    }
    pageContext.cookieScope().setCookie(key, value, expires, secure, path, domain, httponly, preservecase, encode);
    return SKIP_BODY;
}
Also used : CookieData(lucee.runtime.listener.CookieData) ApplicationContextSupport(lucee.runtime.listener.ApplicationContextSupport) ApplicationContext(lucee.runtime.listener.ApplicationContext) Key(lucee.runtime.type.Collection.Key) ExpressionException(lucee.runtime.exp.ExpressionException)

Aggregations

ExpressionException (lucee.runtime.exp.ExpressionException)1 ApplicationContext (lucee.runtime.listener.ApplicationContext)1 ApplicationContextSupport (lucee.runtime.listener.ApplicationContextSupport)1 CookieData (lucee.runtime.listener.CookieData)1 Key (lucee.runtime.type.Collection.Key)1