If a V0 value contains a backslash or a dquote then it will be converted to a V1 cookie and transformed into a quoted-string. During that transformation checks are made for backslash and dquote characters but they are not escaped consistently. If the value contains a dquote, then it will be escaped. For example, the value «a"b» results in Set-Cookie: foo="a\"b"; Version=1 If the value contains a backslash then it will not be escaped. For example, the value «a\b» results in Set-Cookie: foo="a\b"; Version=1 which means the backslash is then incorrectly escaping the "b" character. If the value contains a dquote and a backslash, then the dquote will be escaped and the backslash will not so «a"b\c» results in Set-Cookie: foo="a\"b\c"; Version=1
Fixed in 8.0.8 for 8.0.9 onwards.
In org.apache.tomcat.util.http.TestSetCookieSupportSeparatorsAllowed there are 3 tests that are marked with @Ignore("bug 55975") If I remove the @Ignore on them, 1 test passes, 2 tests fail. One that passes: Testcase: v1ValueContainsNonV0Separator took 0 sec Two that fail: Testcase: v1ValueContainsBackslashAndQuote took 0,008 sec FAILED expected:<foo=["a\"b\\c"]; Version=1> but was:<foo=[a"b\c]; Version=1> Testcase: v1ValueContainsBackslash took 0 sec FAILED expected:<foo=["a\\b"]; Version=1> but was:<foo=[a\b]; Version=1>
This is fixed. Those bug references were wrong.