cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Sites with same Domain

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

ArthurPerry
Employee
Employee
0 Kudos

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-config>   
     <!-- Session timeout of 30 minutes -->   
     <session-timeout>30</session-timeout>   
     <cookie-config>    
         <max-age>0</max-age>   
     </cookie-config>  
 </session-config>
0 Kudos

i have the same issue. With this solution, the user can visit SiteA and SiteB with the same browser, but neither SiteA or SiteB work properly, the server log shows "ERROR [hybrisHTTP24] [CSRFHandlerInterceptor] CRSF token missmatch!" Even when visiting only one site.

Former Member
0 Kudos

Hi,

After added the above in web.xml, i'm getting the below error while login.

HTTP Status 405 - Request method 'POST' not supported.

Can you please help on this?

Thanks

Ram

Former Member
0 Kudos

How you solved this issue i m also facing same issue