CookiesManagerUtil#deleteCookies does not work in some cases

Olaf Kock, modificado 1 Ano atrás. New Member Mensagem: 1 Data de Entrada: 04/09/23 Postagens Recentes

When using Liferay recommended way to add SameSite: none to JSESSIONID cookie https://help.liferay.com/hc/en-us/articles/12648655215885-SameSite-cookie-attribute it also affects other cookies (custom ones and Liferay ones like "COMPANY_ID", "COOKIE_SUPPORT" etc

This is generally fine as far as I can tell. 

The issue is if we also have https site and "secure" attribute is added to the cookie. In such case adding cookie works but removing it with CookiesManagerUtil#deleteCookies does not as the deletion of cookie does not include secure=true attribute. Looking at the code of CookiesManagerImpl#deleteCookies confirms that:

cookie.setSecure(secure);

is missing.

 

Tested with CE GA89 but same behavior is present on master branch: https://github.com/liferay/liferay-portal/blob/master/modules/apps/cookies/cookies-impl/src/main/java/com/liferay/cookies/internal/manager/CookiesManagerImpl.java#L222

thumbnail
Zsigmond Rab, modificado 1 Ano atrás. Liferay Master Postagens: 764 Data de Entrada: 05/01/10 Postagens Recentes

Hi Rafal,

It's planned to implement the support of the __Secure- prefix also during implementing the https://liferay.atlassian.net/issues/LPD-10595.

Regards,
Zsigmond