Legacy Knowledge Base
Published Jul. 2, 2025

How to keep the session logged between different subdomains

Written By

Rodrigo Mier

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • You need to logging each time you enter in each site even sub domines of the same domain.
  • To keep de same session across different sites that are subdomains of the same domain. For example siteA.example.com and siteB.example.com

Environment

  • Portal 6.2
  • DXP 7.0
  • DXP 7.1
  • DXP 7.2
  • DXP 7.3
  • DXP 7.4

Resolution

  • To keep the same session between subdomains, the domain has to be defined in the session cookie with the following portal property:
    session.cookie.domain=example.com
  • If you use tomcat, you have to modify one extra property
    session.cookie.use.full.hostname[tomcat]=false
  • In addition, the domain must be defined in the context of the application server.
    • In this example, with Tomcat you can define it in their context.xml file with the following parameter:
      <Context sessionCookiePath="/" sessionCookieDomain="example.com">

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base