<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>CookiesManagerUtil#deleteCookies does not work in some cases</title>
  <link rel="self" href="https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122695198" />
  <subtitle>CookiesManagerUtil#deleteCookies does not work in some cases</subtitle>
  <id>https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122695198</id>
  <updated>2026-04-09T12:21:32Z</updated>
  <dc:date>2026-04-09T12:21:32Z</dc:date>
  <entry>
    <title>RE: CookiesManagerUtil#deleteCookies does not work in some cases</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122702737" />
    <author>
      <name>Zsigmond Rab</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122702737</id>
    <updated>2024-06-05T13:32:22Z</updated>
    <published>2024-06-05T13:32:21Z</published>
    <summary type="html">&lt;p&gt;Hi Rafal,&lt;/p&gt;
&lt;p&gt;It's planned to implement the support of
  the&amp;nbsp;&lt;code&gt;__Secure-&lt;/code&gt;&amp;nbsp;prefix also during implementing the&amp;nbsp;&lt;a href="https://liferay.atlassian.net/issues/LPD-10595"&gt;https://liferay.atlassian.net/issues/LPD-10595&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt; Zsigmond&lt;/p&gt;</summary>
    <dc:creator>Zsigmond Rab</dc:creator>
    <dc:date>2024-06-05T13:32:21Z</dc:date>
  </entry>
  <entry>
    <title>CookiesManagerUtil#deleteCookies does not work in some cases</title>
    <link rel="alternate" href="https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122695197" />
    <author>
      <name>Rafal Pydyniak</name>
    </author>
    <id>https://liferay.dev/en/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122695197</id>
    <updated>2024-06-05T08:59:57Z</updated>
    <published>2024-06-03T10:12:16Z</published>
    <summary type="html">&lt;p&gt;When using Liferay recommended way to add SameSite: none to
  JSESSIONID
  cookie&amp;nbsp;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&lt;/p&gt;
&lt;p&gt;This is generally fine as far as I can tell.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;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&amp;nbsp;CookiesManagerUtil#deleteCookies does not as the
  deletion of cookie does not include secure=true attribute. Looking at
  the code of CookiesManagerImpl#deleteCookies confirms that:&lt;/p&gt;
&lt;pre&gt;cookie.setSecure(secure);&lt;/pre&gt;
&lt;p&gt;is missing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Tested with CE GA89 but same behavior is present on master branch:&amp;nbsp;https://github.com/liferay/liferay-portal/blob/master/modules/apps/cookies/cookies-impl/src/main/java/com/liferay/cookies/internal/manager/CookiesManagerImpl.java#L222&lt;/p&gt;</summary>
    <dc:creator>Rafal Pydyniak</dc:creator>
    <dc:date>2024-06-03T10:12:16Z</dc:date>
  </entry>
</feed>
