- bug report? yes
- feature request? no
- version: 2.4.5, the code in master looks the same
Description
Due to Response::setCookie() calling Helpers::removeDuplicateCookies(), it is not possible to delete a cookie with the same name from multiple domains.
Came upon it today when I found out there may be accidental cookies for subdomains in our project instead of one cookie for our root domain. Tried to delete all the cookies in the subdomains using Response, but failed.
A naive solution would be to put the Helpers::removeDuplicateCookies() call in a condition, which could be controlled by a parameter of Response::setCookie(), the same for Response::deleteCookie(), but these methods can be called from anywhere and even one call w/o the flag to not call the Helpers::removeDuplicateCookies() would break it.
Having this setting as a settable class property would probably work.
Actually I don't know why the Helpers::removeDuplicateCookies() is there, so I cannot really tell if it would make sense.
Steps To Reproduce
$response->deleteCookie('lang', null, 'sub.domain.com');
$response->deleteCookie('lang', null, 'domain.com');
Description
Due to
Response::setCookie()callingHelpers::removeDuplicateCookies(), it is not possible to delete a cookie with the same name from multiple domains.Came upon it today when I found out there may be accidental cookies for subdomains in our project instead of one cookie for our root domain. Tried to delete all the cookies in the subdomains using
Response, but failed.A naive solution would be to put the
Helpers::removeDuplicateCookies()call in a condition, which could be controlled by a parameter ofResponse::setCookie(), the same forResponse::deleteCookie(), but these methods can be called from anywhere and even one call w/o the flag to not call theHelpers::removeDuplicateCookies()would break it.Having this setting as a settable class property would probably work.
Actually I don't know why the
Helpers::removeDuplicateCookies()is there, so I cannot really tell if it would make sense.Steps To Reproduce