Support configuring secure session cookies. - #7798
Open
xiewxin wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改内容
session.options.cookie_secure配置,用于显式控制 Session Cookie 的Secure属性。true或false时使用显式值。null或未配置时,继续根据请求 URI 的 scheme 自动判断,保持现有行为不变。null。问题原因
当前 Session Cookie 的
Secure属性只根据请求 URI 是否为 HTTPS 判断。当 TLS 在反向代理终止、应用层接收到 HTTP 请求时,使用者无法强制为 Session Cookie 设置
Secure属性。本次修改只增加显式配置能力,不解析代理请求头,也不因
SameSite=None自动强制开启Secure。测试
Secure的测试。Secure的测试。null和未配置时保留原有自动判断行为的测试。Fixes #7301.