I need to delete the JSESSIONID cookie when the user logs out. To do this, I added the following configuration to my security configuration:
<http>
<form-login login-page="/login*" authentication-failure-url="/login?try_again" />
<http-basic />
<logout logout-url="/logout" delete-cookies="JSESSIONID" />
<session-management invalid-session-url="/timeout" />
<intercept-url pattern="/login*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
...
</http>
But instead of being deleted, the cookie is simply duplicated:


Thus, it redirects the browser to the "/ timeout" URL.
I tried to track what was happening using the Developer Tools web browser in the Chrome browser, and I found out that this cookie is configured with this response header:
Set-Cookie:JSESSIONID=CFF85EA743724F23FDA0317A75CFAD44; Path=/website/; HttpOnly
And removes this response header:
Set-Cookie:JSESSIONID=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/website
I'm not sure, but there seems to be a reason in the Path field of these headers: in the first, it points to "/ website /", and in the second it points to "/ website".
? ( ), ()? ?