Skip to content

Conversation

@edwardteach42
Copy link

Added new option:
withUrlEncode(true);

This allows you to enable the php urlencod() on the cookie name and value if needed. This was necessary as most of my cookies are base64 encoded for AWS CloudFront and the equals symbol.

@ajgarlag
Copy link

Your PR is a BC break and the tests are broken. To avoid it, the urlEncode property should be true by default. You should add some tests for your added feature.

Anyway there are at least three points where you should skip the urlencode and urldecode calls:

$cookieStringParts = [
urlencode($this->name).'='.urlencode($this->value),
];

public function __toString()
{
return urlencode($this->name).'='.urlencode($this->value);
}

return array_map(function ($part) {
return urldecode($part);
}, $pairParts);

Base automatically changed from master to main January 22, 2021 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants