Issue #12255 Dump CookieConfig (#12257)

This commit is contained in:
Jan Bartel 2024-09-18 21:57:30 +10:00 committed by GitHub
parent dc43f3d498
commit 41333a7712
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View File

@ -251,6 +251,14 @@ public class SessionHandler extends AbstractSessionManager implements Handler.Si
SessionHandler.this.setSecureCookies(secure);
}
@Override
public String toString()
{
return String.format("%s@%x[name=%s,domain=%s,path=%s,max-age=%d,secure=%b,http-only=%b,comment=%s,attributes=%s]",
this.getClass().getName(), this.hashCode(), getName(), getDomain(), getPath(),
getMaxAge(), isSecure(), isHttpOnly(), getComment(), getSessionCookieAttributes().toString());
}
private void checkState()
{
//It is allowable to call the CookieConfig.setXX methods after the SessionHandler has started,
@ -381,6 +389,10 @@ public class SessionHandler extends AbstractSessionManager implements Handler.Si
public SessionHandler()
{
setSessionTrackingModes(DEFAULT_SESSION_TRACKING_MODES);
installBean(_cookieConfig);
installBean(_sessionListeners);
installBean(_sessionIdListeners);
installBean(_sessionAttributeListeners);
}
@Override

View File

@ -729,6 +729,14 @@ public class SessionHandler extends ScopedHandler implements SessionConfig.Mutab
checkAvailable();
_sessionManager.setSecureCookies(secure);
}
@Override
public String toString()
{
return String.format("%s@%x[name=%s,domain=%s,path=%s,max-age=%d,secure=%b,http-only=%b,same-site=%s,comment=%s]",
this.getClass().getName(), this.hashCode(), _sessionManager.getSessionCookie(), _sessionManager.getSessionDomain(), _sessionManager.getSessionPath(),
_sessionManager.getMaxCookieAge(), _sessionManager.isSecureCookies(), _sessionManager.isHttpOnly(), _sessionManager.getSameSite(), _sessionManager.getSessionComment());
}
}
private class CoreSessionManager extends AbstractSessionManager