List of usage examples for io.netty.handler.codec.http.cookie DefaultCookie setDomain
@Override
public void setDomain(String domain)
From source file:ratpack.pac4j.internal.RatpackWebContext.java
License:Apache License
@Override public void addResponseCookie(Cookie cookie) { final DefaultCookie newCookie = new DefaultCookie(cookie.getName(), cookie.getValue()); newCookie.setDomain(cookie.getDomain()); newCookie.setPath(cookie.getPath()); if (cookie.getMaxAge() >= 0) { newCookie.setMaxAge(cookie.getMaxAge()); }/*from ww w . ja v a 2s. com*/ newCookie.setSecure(cookie.isSecure()); newCookie.setHttpOnly(cookie.isHttpOnly()); response.getCookies().add(newCookie); }
From source file:ratpack.session.internal.CookieBasedSessionId.java
License:Apache License
private void setCookie(String value, Duration expiration) { DefaultCookie cookie = new DefaultCookie(cookieConfig.getIdName(), value); String cookieDomain = cookieConfig.getDomain(); if (cookieDomain != null) { cookie.setDomain(cookieDomain); }/*from ww w . j a v a 2s. co m*/ String cookiePath = cookieConfig.getPath(); if (cookiePath != null) { cookie.setPath(cookiePath); } long expirySeconds = expiration == null ? 0 : expiration.getSeconds(); if (expirySeconds > 0) { cookie.setMaxAge(expirySeconds); } cookie.setHttpOnly(cookieConfig.isHttpOnly()); cookie.setSecure(cookieConfig.isSecure()); response.getCookies().add(cookie); }