Examples of CookieConfig


Examples of com.alibaba.citrus.service.requestcontext.session.SessionConfig.CookieConfig

    /**
     * дcookie��
     */
    private void writeSessionIDCookie(String cookieValue) {
        CookieConfig cookieConfig = sessionConfig.getId().getCookie();
        CookieSupport cookie = new CookieSupport(cookieConfig.getName(), cookieValue);
        String cookieDomain = cookieConfig.getDomain();

        if (!StringUtil.isEmpty(cookieDomain)) {
            cookie.setDomain(cookieDomain);
        }

        String cookiePath = cookieConfig.getPath();

        if (!StringUtil.isEmpty(cookiePath)) {
            cookie.setPath(cookiePath);
        }

        int cookieMaxAge = cookieConfig.getMaxAge();

        if (cookieMaxAge > 0) {
            cookie.setMaxAge(cookieMaxAge);
        }

        cookie.setHttpOnly(cookieConfig.isHttpOnly());
        cookie.setSecure(cookieConfig.isSecure());

        log.debug("Set-cookie: {}", cookie);

        cookie.addCookie(getResponse());
    }
View Full Code Here

Examples of com.alibaba.citrus.service.requestcontext.session.SessionConfig.CookieConfig

        writeSessionIDCookie("");
    }

    /** 写cookie。 */
    private void writeSessionIDCookie(String cookieValue) {
        CookieConfig cookieConfig = sessionConfig.getId().getCookie();
        CookieSupport cookie = new CookieSupport(cookieConfig.getName(), cookieValue);
        String cookieDomain = cookieConfig.getDomain();

        if (!StringUtil.isEmpty(cookieDomain)) {
            cookie.setDomain(cookieDomain);
        }

        String cookiePath = cookieConfig.getPath();

        if (!StringUtil.isEmpty(cookiePath)) {
            cookie.setPath(cookiePath);
        }

        int cookieMaxAge = cookieConfig.getMaxAge();

        if (cookieMaxAge > 0) {
            cookie.setMaxAge(cookieMaxAge);
        }

        cookie.setHttpOnly(cookieConfig.isHttpOnly());
        cookie.setSecure(cookieConfig.isSecure());

        log.debug("{}", cookie);

        cookie.addCookie(getResponse());
    }
View Full Code Here

Examples of com.alibaba.citrus.service.requestcontext.session.SessionConfig.CookieConfig

        writeSessionIDCookie("");
    }

    /** 写cookie。 */
    private void writeSessionIDCookie(String cookieValue) {
        CookieConfig cookieConfig = sessionConfig.getId().getCookie();
        CookieSupport cookie = new CookieSupport(cookieConfig.getName(), cookieValue);
        String cookieDomain = cookieConfig.getDomain();

        if (!StringUtil.isEmpty(cookieDomain)) {
            cookie.setDomain(cookieDomain);
        }

        String cookiePath = cookieConfig.getPath();

        if (!StringUtil.isEmpty(cookiePath)) {
            cookie.setPath(cookiePath);
        }

        int cookieMaxAge = cookieConfig.getMaxAge();

        if (cookieMaxAge > 0) {
            cookie.setMaxAge(cookieMaxAge);
        }

        cookie.setHttpOnly(cookieConfig.isHttpOnly());
        cookie.setSecure(cookieConfig.isSecure());

        log.debug("Set-cookie: {}", cookie);

        cookie.addCookie(getResponse());
    }
View Full Code Here

Examples of com.alibaba.citrus.service.requestcontext.session.SessionConfig.CookieConfig

    /**
     * дcookie��
     */
    private void writeSessionIDCookie(String cookieValue) {
        CookieConfig cookieConfig = sessionConfig.getId().getCookie();
        CookieSupport cookie = new CookieSupport(cookieConfig.getName(), cookieValue);
        String cookieDomain = cookieConfig.getDomain();

        if (!StringUtil.isEmpty(cookieDomain)) {
            cookie.setDomain(cookieDomain);
        }

        String cookiePath = cookieConfig.getPath();

        if (!StringUtil.isEmpty(cookiePath)) {
            cookie.setPath(cookiePath);
        }

        int cookieMaxAge = cookieConfig.getMaxAge();

        if (cookieMaxAge > 0) {
            cookie.setMaxAge(cookieMaxAge);
        }

        cookie.setHttpOnly(cookieConfig.isHttpOnly());
        cookie.setSecure(cookieConfig.isSecure());

        log.debug("Set-cookie: {}", cookie);

        cookie.addCookie(getResponse());
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.web.CookieConfig

        } else if (name.equals(RuntimeTagNames.MAX_IN_MEMORY_SESSIONS)) {
            // make sure that it is an integer
            int maxSessions = Integer.parseInt(value);
            addManagerProperty(MAX_SESSIONS, value);
        } else if (name.equals(RuntimeTagNames.COOKIE_NAME)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setName(value);
        } else if (name.equals(RuntimeTagNames.COOKIE_PATH)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setPath(value);
        } else if (name.equals(RuntimeTagNames.COOKIE_DOMAIN)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setDomain(value);
        } else if (name.equals(RuntimeTagNames.COOKIE_COMMENT)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setComment(value);
        } else if (name.equals(RuntimeTagNames.COOKIE_SECURE)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setSecure(Boolean.parseBoolean(value));
        } else if (name.equals(RuntimeTagNames.COOKIE_MAX_AGE_SECS)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setMaxAge(Integer.parseInt(value));
        } else if (name.equals(RuntimeTagNames.COOKIE_HTTP_ONLY)) {
            CookieConfig cookieConfig = getCookieConfig();
            cookieConfig.setHttpOnly(Boolean.parseBoolean(value));
        } else if (name.equals(RuntimeTagNames.COOKIES_ENABLED)) {
            cookieTrackingMode = Boolean.parseBoolean(value);
        } else if (name.equals(RuntimeTagNames.URL_REWRITING_ENABLED)) {
            urlTrackingMode = Boolean.parseBoolean(value);
        } else if (name.equals(RuntimeTagNames.PERSISTENT_STORE_DIR)) {
View Full Code Here

Examples of com.sun.enterprise.deployment.web.CookieConfig

            Set<SessionTrackingMode> trackingModes = sessionConfig.getTrackingModes();
            if (trackingModes.contains(SessionTrackingMode.COOKIE)) {
                appendTextChild(scNode, RuntimeTagNames.COOKIES_ENABLED, "true");
            }

            CookieConfig cookieConfig = sessionConfig.getCookieConfig();
            if (cookieConfig != null) {
                if (cookieConfig.getName() != null && cookieConfig.getName().length() > 0) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_NAME, cookieConfig.getName());
                }
                if (cookieConfig.getPath() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_PATH, cookieConfig.getPath());
                }
                if (cookieConfig.getDomain() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_DOMAIN, cookieConfig.getDomain());
                }
                if (cookieConfig.getComment() != null) {
                    appendTextChild(scNode, RuntimeTagNames.COOKIE_COMMENT, cookieConfig.getComment());
                }
                appendTextChild(scNode, RuntimeTagNames.COOKIE_SECURE,
                        Boolean.toString(cookieConfig.isSecure()));
                appendTextChild(scNode, RuntimeTagNames.COOKIE_MAX_AGE_SECS,
                        Integer.toString(cookieConfig.getMaxAge()));
                appendTextChild(scNode, RuntimeTagNames.COOKIE_HTTP_ONLY,
                        Boolean.toString(cookieConfig.isHttpOnly()));
            }

            if (trackingModes.contains(SessionTrackingMode.URL)) {
                appendTextChild(scNode, RuntimeTagNames.URL_REWRITING_ENABLED, "true");
            }
View Full Code Here

Examples of com.sun.enterprise.deployment.web.CookieConfig

    /**
     * Get and create a CookieConfigDescriptor if necessary.
     */
    private CookieConfig getCookieConfig() {
        SessionConfig sessionConfig = getSessionConfig();
        CookieConfig cookieConfig = sessionConfig.getCookieConfig();
        if (cookieConfig == null) {
            cookieConfig = new CookieConfigDescriptor();
            sessionConfig.setCookieConfig(cookieConfig);
        }
        return cookieConfig;
View Full Code Here

Examples of org.apache.openejb.jee.CookieConfig

    }

    private CookieConfig getCookieConfig(WebApp webApp, MergeContext context) {
        SessionConfig sessionConfig = getSessionConfig(webApp, context);
        if (sessionConfig.getCookieConfig() == null) {
            sessionConfig.setCookieConfig(new CookieConfig());
        }
        return sessionConfig.getCookieConfig();
    }
View Full Code Here

Examples of org.apache.openejb.jee.CookieConfig

            if (mergeSingleAttribute(context, "timeout", "session-config.session-timeout", "" + sessionConfig.getSessionTimeout(), null, elementSource)) {
                getSessionConfig(webApp, context).setSessionTimeout(sessionConfig.getSessionTimeout());
            }
        }
        if (sessionConfig.getCookieConfig() != null) {
            CookieConfig cookieConfig = sessionConfig.getCookieConfig();
            if (cookieConfig.getName() != null && mergeSingleAttribute(context, "name", "session-config.cookie-config.name", cookieConfig.getName(), null, elementSource)) {
                getCookieConfig(webApp, context).setName(cookieConfig.getName());
            }
            if (cookieConfig.getDomain() != null && mergeSingleAttribute(context, "domain", "session-config.cookie-config.domain", cookieConfig.getDomain(), null, elementSource)) {
                getCookieConfig(webApp, context).setDomain(cookieConfig.getDomain());
            }
            if (cookieConfig.getPath() != null && mergeSingleAttribute(context, "path", "session-config.cookie-config.path", cookieConfig.getPath(), null, elementSource)) {
                getCookieConfig(webApp, context).setPath(cookieConfig.getPath());
            }
            if (cookieConfig.getComment() != null && mergeSingleAttribute(context, "comment", "session-config.cookie-config.comment", cookieConfig.getComment(), null, elementSource)) {
                getCookieConfig(webApp, context).setComment(cookieConfig.getComment());
            }
            if (cookieConfig.getHttpOnly() != null && mergeSingleAttribute(context, "http-only", "session-config.cookie-config.http-only", "" + cookieConfig.getHttpOnly(), null, elementSource)) {
                getCookieConfig(webApp, context).setHttpOnly(cookieConfig.getHttpOnly());
            }
            if (cookieConfig.getSecure() != null && mergeSingleAttribute(context, "secure", "session-config.cookie-config.secure", "" +  cookieConfig.getSecure(), null, elementSource)) {
                getCookieConfig(webApp, context).setSecure(cookieConfig.getSecure());
            }
            if (cookieConfig.getMaxAge() != null && mergeSingleAttribute(context, "max-age", "session-config.cookie-config.max-age""" +cookieConfig.getMaxAge(), null, elementSource)) {
                getCookieConfig(webApp, context).setMaxAge(cookieConfig.getMaxAge());
            }
        }
        if (elementSource.equals(ElementSource.WEB_FRAGMENT) && !sessionConfig.getTrackingMode().isEmpty()) {
            for (TrackingMode trackingMode : sessionConfig.getTrackingMode()) {
                if (!context.containsAttribute("session-config.tracking-mode." + trackingMode)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.