Developer forum

Forum » Development » Cross site cart cookies

Cross site cart cookies

Jesper Frandsen
Reply

Hi

I have a client with a specific request. Lets say they have to sites, set up as language layers in DW. The sites have their own individual domains. But they would like the cart to be shared between the sites (and by extension the domains). I know sharing cookies between domains can be a hassle, but the RFC for cookes state; that cookies can be shared freely between root and subdomains. This would require us to set the cart cookies in a specific way, so my questions is; can this even be done in DW?

If anyone has any other idea as to sharing the cart, I would be grateful to know

Kind regards


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Jesper

If your websites share domain, but have different host, you can share the cookie - as you have found in the RFC.

And Dynamicweb also supports that - if you set it in the cookie manager:

If you have other websites on other domains, they will also be affected - usually not a problem as long as each website has their own domains.

You cannot, however, share cookies across domains. dynamicweb.dk and dynamicweb.com cannot share cookies. Not in Dynamicweb, not in any other situations.

If you have different domains (and not different hosts) you need to find other ways of share the cart.

In Dynamiweb carts have an ID (Cart123) and a secret. Using that ID and secret, you can load up an order (or cart) using the cart command loadorder - see this:

https://doc.dynamicweb.com/documentation-9/ecommerce/frontend/cart-commands#10197

That will pickup a cart from domain 1 on domain 2, but it is not a real share of carts as you would get by using different hosts on the same domain and setup cookies accordingly (i.e. dk.domain.com and se.domain.com)

BR Nicolai

Votes for this answer: 1

 

You must be logged in to post in the forum