Legacy Knowledge Base
Published Jul. 2, 2025

Change the GUEST_LANGUAGE_ID cookie to expire Null

Written By

Kanchan Bisht

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

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

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

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

Issue

  • The Guest language ID cookie in Liferay has a one-year expiration, whereas the undefined cookie in the F5 balancer caused the conflict. Is there a way to modify the Cookie's duration in Liferay?

Environment

  • Liferay DXP 7.0

Resolution

  • The property session.enable.persistent.cookies=false will make the portal stop adding and checking the persistent cookies (CookieKeys.java), but it will not delete or expire the cookies that already exist. For users that already have the cookie stored in their browser, they will need to clear those cookies via the browser. Aside from this property, Liferay doesn't have anything on the portal to control the cookie GUEST_LANGUAGE_ID out-of-the-box.

Additional Information

  • There are a few workarounds that can be suggested here:
    • Try to change the configuration of the F5 with respect to the handling of the sticky session and the cookie JSESSIONID that needs to be changed by Hash persistence.
    • Try to pick up another load balancer like Nginx or Apache and validate if the error happens at this level as well. 
    • Another suggestion would be for users to change the date in the cookie from F5 to one year so that it matches Liferay's expiration date.
    • Sticky session with apache web server and tomcat servers
  • Third-party technology providers are in charge of fixing flaws in their technologies. For more information, users should contact the appropriate third-party technology vendor.
Did this article resolve your issue ?

Legacy Knowledge Base