RFC: Default Cache-Control
headers for the GET session
endpoint
#11340
ThangHuuVu
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
To enhance security and privacy by adding default
Cache-Control
headers to theGET session
endpoint in Auth.js, ensuring that session information is not cached by browsers or intermediaries, like CDNs.Non-Goals
Background
See: #1153 (comment)
Some CDNs such as Cloudflare or AWS CloudFront would cache GET requests by default. This requires the developers to set the cache rule on the cloud providers side which is prone to misconfigurations.
To mitigate this risk, returning the
Cache-Control
header from the core will instruct these providers to respect the cache rule and not to store the session information.References:
Proposal
Update the
GET session
endpoint handling to includeCache-Control
headers in the response. The following headers will be set:Cache-Control: private, no-cache, no-store
Expires: 0
Pragma: no-cache
: Ensures compatibility with HTTP/1.0 caches, which may not recognize Cache-Control.Steps:
Backward compatibility: I don't expect this to break any existing functionalities.
Beta Was this translation helpful? Give feedback.
All reactions