Mantis - Resin
Viewing Issue Advanced Details
6167 minor always 06-23-18 19:15 07-12-18 14:22
ferg  
ferg  
normal  
closed  
fixed  
none    
none 4.0.58  
0006167: cookie-same-site
(rep by Steffan Busch)

But just adding the <cookie-same-site> was not working for our existing ssl-session-cookie:

          <!--
             - For security, set the HttpOnly flag in cookies.
          -->
          <cookie-http-only/>
+ <cookie-same-site>Strict</cookie-same-site>


After looking into the Source of AbstractHttpResponse.java I've seen that the Same-Site logic is in a "if (version > 0) {" block.
So I have added this:

          <session-config>
            <use-persistent-store>false</use-persistent-store>
            <enable-url-rewriting>false</enable-url-rewriting>
+ <cookie-version>1</cookie-version>
          </session-config>

which will cause that now there are two Cookie Headers in the Response:

Set-Cookie: __Host-SSLJSESSIONID=aaa-ZjfzyD5KS98U2iNqw; Path=/; Secure; Version=1; SameSite=Strict; HttpOnly
Set-Cookie2: __Host-SSLJSESSIONID="aaa-ZjfzyD5KS98U2iNqw"; Path="/"; Secure; Version=1; SameSite=Strict; HttpOnly


Wouldn't it be possible to have the Same-Site Cookie configuration without the obsolete[1] Set-Cookie2 feature?


Notes
(0006840)
ferg   
07-12-18 14:22   
server/01em