You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the Cookie class gave the option to not URL-encode the value. I'm working with a 3rd party application that I need to have use the same cookie, but it can't because it doesn't expect the value to be URL-encoded. This forces me to set the cookie using setrawcookie() outside of the framework.
I imagine the constructor for the Cookie class could have a "do url-encoding" parameter, defaulted to true. When set to false, the Response class could conditionally use setrawcookie() instead of setcookie().
The text was updated successfully, but these errors were encountered:
dlancea
changed the title
Allow for setting cookie values that are not URL-encoded in the HttpFoundation\Cookie class
Allow setting cookie values that will not be URL-encoded in the HttpFoundation\Cookie clas
Feb 11, 2015
dlancea
changed the title
Allow setting cookie values that will not be URL-encoded in the HttpFoundation\Cookie clas
Allow setting cookie values that will not be URL-encoded in the HttpFoundation\Cookie class
Feb 11, 2015
…n the response (jakzal)
This PR was merged into the 3.1-dev branch.
Discussion
----------
[HttpFoundation] Add support for sending raw cookies in the response
| Q | A
| ------------- | ---
| Branch | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #13646
| License | MIT
| Doc PR | TODO
Commits
-------
43760a6 [HttpFoundation] Add support for sending raw cookies in the response
The HttpFoundation Cookie class accepts the value of the cookie but PHP will URL-encode the value when using the setcookie() function. This happens in the Response class:
https://github.com/symfony/HttpFoundation/blob/master/Response.php#L348
It would be nice if the Cookie class gave the option to not URL-encode the value. I'm working with a 3rd party application that I need to have use the same cookie, but it can't because it doesn't expect the value to be URL-encoded. This forces me to set the cookie using setrawcookie() outside of the framework.
I imagine the constructor for the Cookie class could have a "do url-encoding" parameter, defaulted to true. When set to false, the Response class could conditionally use setrawcookie() instead of setcookie().
The text was updated successfully, but these errors were encountered: