Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sameSite 设置无效 #4595

Closed
SSShooter opened this issue Jan 31, 2021 · 9 comments
Closed

sameSite 设置无效 #4595

SSShooter opened this issue Jan 31, 2021 · 9 comments

Comments

@SSShooter
Copy link

sameSite 设置无效

module.exports = {
  cookies: {
    sameSite: 'none',
  },
};

复现步骤,错误日志以及相关配置

cookies 成功写入,但没遇 sameSite none

相关环境信息

  • 操作系统:windows10
  • Node 版本:v12.18.0
  • Egg 版本:2.29.1

是否需要配置其他参数?或者引入插件?

@SSShooter
Copy link
Author

或者是因为版本升级操作有问题?顺便问一下如何进行版本升级

@gemwuu
Copy link
Member

gemwuu commented Feb 18, 2021

给下最小复现代码仓库

@egg-bot
Copy link

egg-bot commented Feb 18, 2021

Hello @SSShooter. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@SSShooter,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。

1 similar comment
@egg-bot
Copy link

egg-bot commented Feb 18, 2021

Hello @SSShooter. Please provide a reproducible example following the instruction.

Issues labeled by Need Reproduce will be closed if no activities in 7 days.


@SSShooter,请根据这个说明提供最小可复现代码。

如果在 7 天内没有进展会被自动关闭。

@egg-bot
Copy link

egg-bot commented Feb 27, 2021

This issue is closed because it has been marked as Need Reproduce, but has not had recent activity.
If you can provide a reproduce, feel free to ping anyone of our maintainers to reopen this issue.
Thank you for your contributions.

@egg-bot egg-bot closed this as completed Feb 27, 2021
@SSShooter
Copy link
Author

解决了,session 的 sameSite 属性不归 cookies 配置管,这样就行了:

config.session = {
    key: 'EGG_SESS',
    maxAge: 24 * 3600 * 1000 * 30, 
    httpOnly: true,
    encrypt: true,
    secure: true,
    sameSite: 'None',
  }

@AntiMoron
Copy link

image

image

(sameSite: "None"我也试过了)
这当初issue咋关的?

@woaixiangbao
Copy link

session
我个你一样,也是设置了都无效

@AntiMoron
Copy link

AntiMoron commented Apr 18, 2024

@gemwuu 你真是乱弹琴吧,这么好复现的东西还问社区要最小复现例子,怎么阿里人是没手了还是咋的。我看就是纯懒政

这玩意整了这么多年都不fix。够衰

就因为你让机器人进入了这个要例子的流程,结果7天自动关了。结果这个issue到今天还是有人能遇到。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants