legacy-knowledge-base
公開されました Jul. 2, 2025

異なるサブドメイン間でセッションを記録し続ける方法

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

learn-legacy-article-disclaimer-text

問題

  • 同じドメインのサブドメインであっても、各サイトに入るたびにログを記録する必要があります。
  • 同じドメインのサブドメインである異なるサイト間で同じセッションを維持するため。 たとえば、siteA.example.com と siteB.example.com

Environment

  • ポータル 6.2
  • DXP 7.0
  • DXP 7.1
  • DXP 7.2
  • DXP 7.3
  • DXP 7.4

解決策

  • サブドメイン間で同じセッションを維持するには、次のポータル プロパティを使用して、セッション Cookie でドメインを定義する必要があります。
    session.cookie.domain=example.com
  • tomcat を使用する場合は、追加のプロパティを 1 つ変更する必要があります
    session.cookie.use.full.hostname[tomcat]=false
  • さらに、ドメインはアプリケーション サーバーのコンテキストで定義する必要があります。
    • この例では、Tomcat を使用して、次のパラメーターを使用して context.xml ファイルで定義できます。
      <Context sessionCookiePath="/" sessionCookieDomain="example.com">

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base