Access to cookie config with accessor method (#5526)
With this minimal change one can provide different cookie configs for the same SessionHandler without coping the whole method into the inherited class. Signed-off-by: Dejan Pecar <dejan.pecar@abacus.ch>
This commit is contained in:
parent
497a908895
commit
22c6b8fced
|
@ -640,7 +640,8 @@ public class SessionHandler extends ScopedHandler
|
|||
{
|
||||
if (isUsingCookies())
|
||||
{
|
||||
String sessionPath = (_cookieConfig.getPath() == null) ? contextPath : _cookieConfig.getPath();
|
||||
SessionCookieConfig cookieConfig = getSessionCookieConfig();
|
||||
String sessionPath = (cookieConfig.getPath() == null) ? contextPath : cookieConfig.getPath();
|
||||
sessionPath = (StringUtil.isEmpty(sessionPath)) ? "/" : sessionPath;
|
||||
String id = getExtendedId(session);
|
||||
HttpCookie cookie = null;
|
||||
|
@ -648,14 +649,14 @@ public class SessionHandler extends ScopedHandler
|
|||
cookie = new HttpCookie(
|
||||
getSessionCookieName(_cookieConfig),
|
||||
id,
|
||||
_cookieConfig.getDomain(),
|
||||
cookieConfig.getDomain(),
|
||||
sessionPath,
|
||||
_cookieConfig.getMaxAge(),
|
||||
_cookieConfig.isHttpOnly(),
|
||||
_cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure),
|
||||
HttpCookie.getCommentWithoutAttributes(_cookieConfig.getComment()),
|
||||
cookieConfig.getMaxAge(),
|
||||
cookieConfig.isHttpOnly(),
|
||||
cookieConfig.isSecure() || (isSecureRequestOnly() && requestIsSecure),
|
||||
HttpCookie.getCommentWithoutAttributes(cookieConfig.getComment()),
|
||||
0,
|
||||
HttpCookie.getSameSiteFromComment(_cookieConfig.getComment()));
|
||||
HttpCookie.getSameSiteFromComment(cookieConfig.getComment()));
|
||||
|
||||
return cookie;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue