use of javax.servlet.http.Cookie in project tomcat by apache.
the class TestCookieProcessorGeneration method v1NullValue.
@Test
public void v1NullValue() {
Cookie cookie = new Cookie("foo", null);
cookie.setVersion(1);
doTest(cookie, "foo=\"\"; Version=1", "foo=");
}
use of javax.servlet.http.Cookie in project tomcat by apache.
the class TestCookieProcessorGeneration method v1ValueContainsBackslash.
@Test
public void v1ValueContainsBackslash() {
Cookie cookie = new Cookie("foo", "a\\b");
cookie.setVersion(1);
doTest(cookie, "foo=\"a\\\\b\"; Version=1", null);
}
use of javax.servlet.http.Cookie in project tomcat by apache.
the class TestCookieProcessorGeneration method v1simpleCookie.
@Test
public void v1simpleCookie() {
Cookie cookie = new Cookie("foo", "bar");
cookie.setVersion(1);
doTest(cookie, "foo=bar; Version=1", "foo=bar");
}
use of javax.servlet.http.Cookie in project tomcat by apache.
the class TestCookies method doTestBug60788.
private void doTestBug60788(boolean useRfc6265) {
Cookie expected = new Cookie("userId", "foo");
expected.setVersion(1);
if (useRfc6265) {
expected.setDomain("\"www.example.org\"");
expected.setPath("\"/\"");
} else {
// The legacy processor removes the quotes for domain and path
expected.setDomain("www.example.org");
expected.setPath("/");
}
test(useRfc6265, "$Version=\"1\"; userId=\"foo\";$Path=\"/\";$Domain=\"www.example.org\"", expected);
}
use of javax.servlet.http.Cookie in project tomcat by apache.
the class TestCookieProcessorGeneration method v0ValueContainsEquals.
@Test
public void v0ValueContainsEquals() {
Cookie cookie = new Cookie("foo", "a=b");
doTestDefaults(cookie, "foo=\"a=b\"; Version=1", "foo=a=b");
doTestAllowSeparators(cookie, "foo=a=b", "foo=a=b");
}
Aggregations