Subdomains and Cookies


I’ve found a lot of questions and answers on this forum and google surrounding implementing cookies across multiple subdomains. Currently I am setting:


so that cookies will work across all domains. However, I have two Yii sites running on the same server one running on a subdomain of the main, a testing site and the main site. Cookies from the main site are able to interfere with the test site. My usecase is that I have a main site a and a test site at Currently my cookieParams are set to:




How can I stop cookies migrating from the main site to the test site? I want to be able to have the equivalent of ‘notDomain’=>‘’.

Any ideas?