@Override public MultiValueMap<String, ResponseCookie> getCookies() { return getDelegate().getCookies(); }
@Override public MultiValueMap<String, ResponseCookie> getCookies() { return getDelegate().getCookies(); }
@Override public MultiValueMap<String, ResponseCookie> cookies() { return response().getCookies(); }
@Override public void setSessionId(ServerWebExchange exchange, String id) { Assert.notNull(id, "'id' is required"); ResponseCookie cookie = initSessionCookie(exchange, id, getCookieMaxAge()); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
@Override public void expireSession(ServerWebExchange exchange) { ResponseCookie cookie = initSessionCookie(exchange, "", Duration.ZERO); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
private void writeStatusAndHeaders(ServerHttpResponse response) { if (response instanceof AbstractServerHttpResponse) { ((AbstractServerHttpResponse) response).setStatusCodeValue(this.statusCode); } else { HttpStatus status = HttpStatus.resolve(this.statusCode); if (status == null) { throw new IllegalStateException( "Unresolvable HttpStatus for general ServerHttpResponse: " + this.statusCode); } response.setStatusCode(status); } copy(this.headers, response.getHeaders()); copy(this.cookies, response.getCookies()); }
@Override public void expireSession(ServerWebExchange exchange) { ResponseCookie cookie = initSessionCookie(exchange, "", Duration.ZERO); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
@Override public void setSessionId(ServerWebExchange exchange, String id) { Assert.notNull(id, "'id' is required"); ResponseCookie cookie = initSessionCookie(exchange, id, getCookieMaxAge()); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
@Override public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) { this.requestCookies = request.getCookies(); this.requestCookies.size(); // Cause lazy loading response.getCookies().add("SID", ResponseCookie.from("SID", "31d4d96e407aad42") .path("/").secure(true).httpOnly(true).build()); response.getCookies().add("lang", ResponseCookie.from("lang", "en-US") .domain("example.com").path("/").build()); return response.setComplete(); } }
@Override public MultiValueMap<String, ResponseCookie> getCookies() { return getDelegate().getCookies(); }
@Override public MultiValueMap<String, ResponseCookie> getCookies() { return getDelegate().getCookies(); }
@Override public void setSessionId(ServerWebExchange exchange, String id) { Assert.notNull(id, "'id' is required"); ResponseCookie cookie = initSessionCookie(exchange, id, getCookieMaxAge()); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
@Override public void expireSession(ServerWebExchange exchange) { ResponseCookie cookie = initSessionCookie(exchange, "", Duration.ZERO); exchange.getResponse().getCookies().set(this.cookieName, cookie); }
boolean secure = "https".equalsIgnoreCase(exchange.getRequest().getURI().getScheme()); String path = exchange.getRequest().getPath().contextPath().value() + "/"; exchange.getResponse().getCookies().set(name, ResponseCookie.from(name, id).path(path) .maxAge(maxAge).httpOnly(true).secure(secure).build());