Skip to content

Comments

feat: add domain argument to SessionMiddleware#2280

Merged
Kludex merged 8 commits intoKludex:masterfrom
zllvm:feature/domain-in-sessionmiddleware
Nov 3, 2023
Merged

feat: add domain argument to SessionMiddleware#2280
Kludex merged 8 commits intoKludex:masterfrom
zllvm:feature/domain-in-sessionmiddleware

Conversation

@zllvm
Copy link
Contributor

@zllvm zllvm commented Sep 13, 2023

Summary

This PR introduces an optional domain parameter to the SessionMiddleware constructor. Users can include this parameter when initializing SessionMiddleware to specify the desired domain for cookie scoping. More information about it can be found, for example, here.

The feature has been discussed in Discussions #1603

Impact

  • Minimal Impact: The changes in this PR are backward-compatible and should not disrupt existing implementations of SessionMiddleware.
  • Opt-In: Users can choose to utilize the new domain parameter when initializing SessionMiddleware, ensuring that it does not affect those who do not use it.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Copy link
Contributor

@abersheeran abersheeran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement!

path: str = "/",
same_site: typing.Literal["lax", "strict", "none"] = "lax",
https_only: bool = False,
domain: str = "",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
domain: str = "",
domain: typing.Optional[str] = None,

@Kludex Kludex enabled auto-merge (squash) November 3, 2023 12:16
@Kludex Kludex disabled auto-merge November 3, 2023 12:16
@Kludex Kludex enabled auto-merge (squash) November 3, 2023 12:16
@Kludex Kludex merged commit e017600 into Kludex:master Nov 3, 2023
@zllvm zllvm deleted the feature/domain-in-sessionmiddleware branch November 15, 2023 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants