cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sameSite Cookie attribute

1,486

How to add sameSite Cookie attribute in hybris 6.2 version?

any suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

christoph_probst
Active Participant

First adapt class ServerCookie in your storefront so that the method appendCookieValue supports an sameSite attribute.

if (sameSite != null) {
    buf.append("; SameSite=");
    maybeQuote(buf, sameSite);
}

Then change the CookieGenerator (you need to extend it to do that) the addCookie method should use the new ServerCookie#appendCookieValue method. Use the newly created cookie generator in your spring config.

The 6.2 is rather old hopefully this works for your version. Upgrade recommended 😉

Answers (0)