Search in sources :

Example 1 with CookieSecureType

use of com.sun.enterprise.web.session.WebSessionCookieConfig.CookieSecureType in project Payara by payara.

the class PwcCoyoteRequest method configureSessionCookie.

/*
     * Configures the given JSESSIONID cookie with the cookie-properties from
     * sun-web.xml.
     *
     * @param cookie The JSESSIONID cookie to be configured
     */
@Override
public void configureSessionCookie(Cookie cookie) {
    super.configureSessionCookie(cookie);
    PwcWebModule wm = (PwcWebModule) getContext();
    WebSessionCookieConfig cookieConfig = (WebSessionCookieConfig) wm.getSessionCookieConfig();
    CookieSecureType type = cookieConfig.getSecure();
    if (CookieSecureType.TRUE == type) {
        cookie.setSecure(true);
    } else if (CookieSecureType.FALSE == type) {
        cookie.setSecure(false);
    } else {
        cookie.setSecure(isSecure());
    }
}
Also used : PwcWebModule(com.sun.enterprise.web.pwc.PwcWebModule) CookieSecureType(com.sun.enterprise.web.session.WebSessionCookieConfig.CookieSecureType) WebSessionCookieConfig(com.sun.enterprise.web.session.WebSessionCookieConfig)

Aggregations

PwcWebModule (com.sun.enterprise.web.pwc.PwcWebModule)1 WebSessionCookieConfig (com.sun.enterprise.web.session.WebSessionCookieConfig)1 CookieSecureType (com.sun.enterprise.web.session.WebSessionCookieConfig.CookieSecureType)1