/** * Set the session cookie name * @param sessionCookieName the session cookie name * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.handler.SessionHandler setSessionCookieName(String sessionCookieName) { delegate.setSessionCookieName(sessionCookieName); return this; }
/** * Set the session cookie name * @param sessionCookieName the session cookie name * @return a reference to this, so the API can be used fluently */ public io.vertx.rxjava.ext.web.handler.SessionHandler setSessionCookieName(String sessionCookieName) { delegate.setSessionCookieName(sessionCookieName); return this; }
@Test public void testSessionCookieName() throws Exception { router.route().handler(CookieHandler.create()); String sessionCookieName = "acme.sillycookie"; router.route().handler(SessionHandler.create(store).setSessionCookieName(sessionCookieName)); router.route().handler(rc -> rc.response().end()); testRequest(HttpMethod.GET, "/", null, resp -> { String setCookie = resp.headers().get("set-cookie"); assertTrue(setCookie.startsWith(sessionCookieName + "=")); }, 200, "OK", null); }
@Test public void testSessionCookieName() throws Exception { router.route().handler(CookieHandler.create()); String sessionCookieName = "acme.sillycookie"; router.route().handler(SessionHandler.create(store).setSessionCookieName(sessionCookieName)); router.route().handler(rc -> rc.response().end()); testRequest(HttpMethod.GET, "/", null, resp -> { String setCookie = resp.headers().get("set-cookie"); assertTrue(setCookie.startsWith(sessionCookieName + "=")); }, 200, "OK", null); }