guoliang3 commented on issue #6314:
URL: https://github.com/apache/shenyu/issues/6314#issuecomment-4174265821

   > 感觉不是 Shenyu 在代理时主动删除了后端 Cookie,是 `v2.5.0` 版本的 shenyu 自身的 WebFlux/Security 
会话机制和系统里的 `SESSION` 冲突了。`SESSION=; Max-Age=0; Expires=Thu, 01 Jan 1970 ...` 
这种响应头像是 Spring WebFlux 在过期自己的 session cookie。
   > 
   > `v2.5.0` 的 `oauth2` 配置里启用了 WebFlux Security 过滤链,会访问 
`exchange.getSession()`;如果浏览器把后端服务的 `SESSION` 一起带到网关,但网关本身没有对应 
session,就可能在响应提交前回写一个删除 `SESSION` 的 `Set-Cookie`。所以会出现“直连后端正常,经过网关后 SESSION 
被清掉”的情况。
   > 
   > 看下是不是用了 Shenyu 的 `oauth2` 相关 starter 配置或者换个网关的 cookie 名字改掉试试。
   > 
   > [@guoliang3](https://github.com/guoliang3) 另外我觉得也升级到最新版本试试,
   
   
   1.是的我也发现SESSION这个名字冲突了如下图,只有SESSION被删除了其他的没变
   
   <!-- Failed to upload "dee38cacefa613ebaca24e75fb99bb42.png" -->
   
   
   2.看样子确实是shenyu-spring-boot-starter-plugin-oauth2的问题
   
   <img width="1431" height="401" alt="Image" 
src="https://github.com/user-attachments/assets/87cf6fc0-fa54-46a2-a633-83a6b64fd3e5";
 />
   注释掉shenyu-spring-boot-starter-plugin-oauth2 就不删除了
   
   <img width="994" height="824" alt="Image" 
src="https://github.com/user-attachments/assets/88cd50fe-d7aa-4775-a230-846b67d56044";
 />
   
   我发现这个插件还是关闭状态
   
   <img width="1745" height="599" alt="Image" 
src="https://github.com/user-attachments/assets/097fcdbd-8d42-47bd-9c76-f7dd1b4271c6";
 />
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to