<?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>Persistent Cookies cross app contamination.</title>
  <link rel="self" href="https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=1621432" />
  <subtitle>Persistent Cookies cross app contamination.</subtitle>
  <id>https://liferay.dev/ca/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=1621432</id>
  <updated>2026-05-07T16:44:03Z</updated>
  <dc:date>2026-05-07T16:44:03Z</dc:date>
  <entry>
    <title>Persistent Cookies cross app contamination.</title>
    <link rel="alternate" href="https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1621431" />
    <author>
      <name>Alex Wallace</name>
    </author>
    <id>https://liferay.dev/ca/c/message_boards/find_message?p_l_id=119785294&amp;messageId=1621431</id>
    <updated>2008-11-21T16:39:31Z</updated>
    <published>2008-11-21T16:39:31Z</published>
    <summary type="html">Hi All... &lt;br /&gt;&lt;br /&gt;I see an issue with the current way persistent cookies are created.&lt;br /&gt;&lt;br /&gt;First, since there is no option to use the strict sub domain name for the cookie domain, the cookies are made available to a wide set of applications. &lt;br /&gt;&lt;br /&gt;We run php and other liferay instances in the same domain, (phpapp1.mydomain.com, phpapp2.mdomain.com, liferay-stage.mydomain.com liferay-live.mydomain.com) and by visiting any of the liferay instances a set of cookies are made available to all applications... &lt;br /&gt;&lt;br /&gt;&lt;a href="http://issues.liferay.com/browse/LEP-5994"&gt;LEP-5994&lt;/a&gt; seems to fix the issue of wrong company Id things... But what if the company id does match accross the liferay sites but you don&amp;#39;t really intend to authenticate users accross?&lt;br /&gt;&lt;br /&gt;Further more, the cookie names are really very generic. COMPANY_ID and ID for example are possibly used as well in other applications...&lt;br /&gt;&lt;br /&gt;In PHP, $_REQUEST will give you the cookie values as well... Some of the apps we run look for ID in the $_REQUEST and needless to say, they are getting the unexpected value liferay sets on ID...    Bad php apps... bad app... &lt;br /&gt;&lt;br /&gt;In my opinion, there should be, if possible, an option to force the persistent cookies to use the same domain used for example for COOKIE_SUPPORT, the full server subdomain being accessed.&lt;br /&gt;&lt;br /&gt;I imaging there could be a reason to share these cookies accross sub domains, but I think there could be a configurable property in portal.properties to use the strict subdomain.&lt;br /&gt;&lt;br /&gt;Second, it may be a good idea to be able to prefix the cookie names with some configurable value so that the names are not so generic and can be shared, but minimize the risk of collisions...&lt;br /&gt;&lt;br /&gt;I would love to hear from LR about this, and definitely willing to contribute the change if it makes sense and doesn&amp;#39;t pose dangers I&amp;#39;m not thinking about...&lt;br /&gt;&lt;br /&gt;Thanks!</summary>
    <dc:creator>Alex Wallace</dc:creator>
    <dc:date>2008-11-21T16:39:31Z</dc:date>
  </entry>
</feed>
