Skip to content

Commit

Permalink
Issue #12255 Dump CookieConfig (#12257)
Browse files Browse the repository at this point in the history
  • Loading branch information
janbartel committed Sep 18, 2024
1 parent dc43f3d commit 41333a7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ public void setSecure(boolean secure)
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,
Expand Down Expand Up @@ -381,6 +389,10 @@ public boolean isNew()
public SessionHandler()
{
setSessionTrackingModes(DEFAULT_SESSION_TRACKING_MODES);
installBean(_cookieConfig);
installBean(_sessionListeners);
installBean(_sessionIdListeners);
installBean(_sessionAttributeListeners);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,14 @@ public void setSecure(boolean secure)
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
Expand Down

0 comments on commit 41333a7

Please sign in to comment.