use of lucee.runtime.listener.SessionCookieData in project Lucee by lucee.
the class PageContextImpl method setClientCookies.
private void setClientCookies() {
TimeSpan tsExpires = SessionCookieDataImpl.DEFAULT.getTimeout();
String domain = PageContextUtil.getCookieDomain(this);
boolean httpOnly = SessionCookieDataImpl.DEFAULT.isHttpOnly();
boolean secure = SessionCookieDataImpl.DEFAULT.isSecure();
ApplicationContext ac = getApplicationContext();
if (ac instanceof ApplicationContextSupport) {
ApplicationContextSupport acs = (ApplicationContextSupport) ac;
SessionCookieData data = acs.getSessionCookie();
if (data != null) {
// expires
TimeSpan ts = data.getTimeout();
if (ts != null)
tsExpires = ts;
// httpOnly
httpOnly = data.isHttpOnly();
// secure
secure = data.isSecure();
// domain
String tmp = data.getDomain();
if (!StringUtil.isEmpty(tmp, true))
domain = tmp.trim();
}
}
int expires;
long tmp = tsExpires.getSeconds();
if (Integer.MAX_VALUE < tmp)
expires = Integer.MAX_VALUE;
else
expires = (int) tmp;
cookieScope().setCookieEL(KeyConstants._cfid, cfid, expires, secure, "/", domain, httpOnly, true, false);
cookieScope().setCookieEL(KeyConstants._cftoken, cftoken, expires, secure, "/", domain, httpOnly, true, false);
}
Aggregations