Summary of the issue
It is highly recommended that customers upgrade to Tomcat 8.5, as Tomcat 8.0 reached the end of support on June 30, 2018. With Apache Tomcat 8.5, Apache has introduced new features and improved the performance. However, after the upgrade, customers may see an error similar to the following when running a Liferay application:
An invalid domain [.mydomain] was specified for this cookie.
The fix
This error is caused by the introduction of the RFC6265CookieProcessor in Apache Tomcat 8.5.
To remove the error and make Liferay compatible with Apache Tomcat 8.5, the following line should be added to Tomcat’s context.xml file:
<CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
Please note that Apache Tomcat has to be restarted for the changes to take effect.
Summary
Tomcat 8.5 offers enhanced security and significant performance benefits. While the benefits are substantial, you must make a few adjustments to preserve the behavior and mimic the older Tomcat (8.0) environment.
If you have questions about how to best leverage audience targeting or need help with your Liferay DXP implementation, please engage with us via comments on this blog post or reach out directly.
Additional Reading
You can also continue to explore Liferay DXP by checking out the Steps to Follow for Overcoming HTTPS Socket Errors in JMeter or Top 5 DevOps Features in Liferay DXP from a DevOps perspective.