convert pluses to spaces when decoding cookies#62
Conversation
…od), and added/modified tests.
|
As I had stated somewhere else before, what if someone specifically wants to put a "+" into the cookie value? With this pull request this would be changed to " " upon reading (unless using raw), which is not desired obviously in such a case. That said, we cannot simply assume all pluses were having to change to " ". My take on this is - now that we have default options, this is much easier - providing a decode option for this, so that the developer can hook whatever decoding method required into it: This were all a developer needed to do. |
|
Alternatively we'd need to convert pluses first, before doing decodeURIComponent, as mentioned here: #13 (comment) Would you like to adapt the pull request? |
|
My bad, I overlooked that you were already replacing before decoding... sorry. |
This fix will let you set cookies with PHP's
setcookie()method (and probably other languages too), and see spaces as spaces (previously they were plus signs).