美文网首页
api gateway 网关设置cookie

api gateway 网关设置cookie

作者: JeffreyTaiT | 来源:发表于2020-11-26 20:46 被阅读0次

    Filter中存入:

    serverWebExchange.getResponse().addCookie(ResponseCookie.from("sessionId", webSessionId).path("/").maxAge(Duration.ofDays(1)).build());

    Filter中获取:

    HttpCookie httpCookie =exchange.getRequest().getCookies().getFirst("token");

    if (null != httpCookie) {

    String token = httpCookie.getValue();

    System.out.println(token);

    }

    }

    相关文章

      网友评论

          本文标题:api gateway 网关设置cookie

          本文链接:https://www.haomeiwen.com/subject/rqbziktx.html