Cookie someCookie = ctx.getCookie("visits");
@Override public Cookie getCookie(String name) { return decoratedContext.getCookie(name); }
@Override public Cookie getCookie(String name) { return inner.getCookie(name); }
Cookie cookie = context.getCookie(sessionCookieName); if (cookie != null) {
@Override public Cookie getCookie(String name) { return decoratedContext.getCookie(name); }
@Override public Cookie getCookie(String name) { return inner.getCookie(name); }
@Override public Cookie getCookie(String name) { return delegate.getCookie(name); }
/** * Returns a cookie by name * * @param name the cookie name * @return the cookie */ public Cookie cookie(String name) { return context.getCookie(name); }
@Override public Cookie getCookie(String name) { return delegate.getCookie(name); }
@Override public Cookie getCookie(String name) { return this.inner.getCookie(name); }
final Cookie cookie = context.getCookie(sessionCookieName);
@Test public void testSimpleCookie() throws Exception { router.route().handler(rc -> { assertEquals(1, rc.cookieCount()); Cookie cookie = rc.getCookie("foo"); assertNotNull(cookie); assertEquals("bar", cookie.getValue()); rc.response().end(); }); testRequestWithCookies(HttpMethod.GET, "/", "foo=bar", 200, "OK"); }
router.route().handler(rc -> { assertEquals(3, rc.cookieCount()); assertEquals("bar", rc.getCookie("foo").getValue()); assertEquals("blibble", rc.getCookie("wibble").getValue()); assertEquals("flop", rc.getCookie("plop").getValue()); rc.removeCookie("plop"); }); router.route().handler(rc -> { assertEquals("bar", rc.getCookie("foo").getValue()); assertEquals("blibble", rc.getCookie("wibble").getValue()); assertNotNull(rc.getCookie("plop")); rc.addCookie(Cookie.cookie("fleeb", "floob")); assertEquals(4, rc.cookieCount()); assertNull(rc.removeCookie("blarb")); assertEquals(4, rc.cookieCount()); Cookie foo = rc.getCookie("foo"); foo.setValue("blah"); rc.response().end();
/** * Get the cookie with the specified name. The context must have first been routed to a {@link io.vertx.rxjava.ext.web.handler.CookieHandler} * for this to work. * @param name the cookie name * @return the cookie */ public io.vertx.rxjava.ext.web.Cookie getCookie(String name) { io.vertx.rxjava.ext.web.Cookie ret = io.vertx.rxjava.ext.web.Cookie.newInstance(delegate.getCookie(name)); return ret; }
@Override public Object apply(final String name, final Class<?> paramType, final RoutingContext context) { final Cookie cookie = context.getCookie(name); return cookie.getValue(); } }
@Override public Object apply(final String name, final Class<?> paramType, final RoutingContext context) { final Cookie cookie = context.getCookie(name); return cookie.getValue(); } }
/** * Get the cookie with the specified name. The context must have first been routed to a {@link io.vertx.rxjava.ext.web.handler.CookieHandler} * for this to work. * @param name the cookie name * @return the cookie */ public io.vertx.rxjava.ext.web.Cookie getCookie(String name) { io.vertx.rxjava.ext.web.Cookie ret = io.vertx.rxjava.ext.web.Cookie.newInstance(delegate.getCookie(name)); return ret; }
case PATCH: final String header = ctx.request().getHeader(headerName); final Cookie cookie = ctx.getCookie(cookieName); if (validateToken(header == null ? ctx.request().getFormAttribute(headerName) : header, cookie)) { ctx.next();
@Override public @Nullable Cookie getCookie(String name) { return rc.getCookie(name); }
@Test public void testSimpleCookie() throws Exception { router.route().handler(rc -> { assertEquals(1, rc.cookieCount()); Cookie cookie = rc.getCookie("foo"); assertNotNull(cookie); assertEquals("bar", cookie.getValue()); rc.response().end(); }); testRequestWithCookies(HttpMethod.GET, "/", "foo=bar", 200, "OK"); }