diff --git a/src/Cookie/CookieJar.php b/src/Cookie/CookieJar.php index aac527d9..6d090dbf 100644 --- a/src/Cookie/CookieJar.php +++ b/src/Cookie/CookieJar.php @@ -69,7 +69,7 @@ class CookieJar implements CookieJarInterface { if (substr($value, 0, 1) !== '"' && substr($value, -1, 1) !== '"' && - strpbrk($value, ';,') + strpbrk($value, ';,=') ) { $value = '"' . $value . '"'; } diff --git a/tests/Cookie/CookieJarTest.php b/tests/Cookie/CookieJarTest.php index 94bc4b90..0598b6f2 100644 --- a/tests/Cookie/CookieJarTest.php +++ b/tests/Cookie/CookieJarTest.php @@ -32,6 +32,8 @@ class CookieJarTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('foo', CookieJar::getCookieValue('foo')); $this->assertEquals('"foo,bar"', CookieJar::getCookieValue('foo,bar')); + $this->assertEquals('"foobar="', CookieJar::getCookieValue('foobar=')); + $this->assertEquals('"foo;bar"', CookieJar::getCookieValue('foo;bar')); } public function testCreatesFromArray()