We have a requirement to have two sites with same domain and different URLs as: http://domain/storefront/site1/ http://domain/storefront/site2/ For this we have created two CMS sites and set URL patterns to resolve sites correctly based on URL. But as the domain name is same we are facing issues with JSession cookie and two sites are not running in same browser tabs. When we hit first site the current CMS site is set in session and when we hit next site the existing site is fetched again from the session. But we need to have both sites in session at same time. For this I have updated the setEnhancedCookiePath() method of EnhancedCookieGenerator class to set different paths as storefront/site1/ and storefront/site2/ But I noticed that always two JSession cookies are getting generated one with storefront web root - /storefrontand other by EnhancedCookieGenerator and one by EnhancedCookieGenerator Any points will be appreciated.
You need to ensure the default session cookie is removed. One way to do that is to update the web.xml for your storefront web context so that the the cookie has a max-age of 0:
<!-- Session timeout of 30 minutes -->