Hi there good people of StackOverflow, I have a problem and I was hoping that some of you out there might be able to help me.
Let’s say I am supposed to create some kind of WordPress web shop on http://www.webshop.com domain, written in English language, with a cookie named ‘cartItems’ available for that domain. Ok, not a problem.
The problem is that I also need to make a german version of the site and I need to make difference between english and german cookies.
Now, my question is, if for example the german site is on the http://www.webshop.com/de/ I can set a german cookie to be available only for the /de/ domain, right?
But how can I set that english cookie will be available in all the domains except the /de/ one.
If that can’t be done would it be possible if the german site was on de.webshop.com
Thank you for all the help
There are 3 ways you can separate the English and German cookies
1) Domain:
You could use a separate www. and de. subdomain as you mentioned. To me this would be the easiest
2) Path:
You can use the path, but if your English cookie is set for “/” it will still be accessible under “/de/”. So if you want to go this route you’d need to make a “/en/” path as Kerrek suggested.
3) Name:
Give the German cookie a different name
You will need to do one of those 3 to have separate English and German cookies. I’d think that having a separate subdomain would be the best, because not just your cookie paths but all your asset paths will be the same regardless of language.