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

Enhancement: "Remember me" support for ServerSideSessionBackend / ClientSideSessionBackend #3758

Open
Rey092 opened this issue Sep 25, 2024 · 0 comments
Labels
Enhancement This is a new feature or request

Comments

@Rey092
Copy link

Rey092 commented Sep 25, 2024

Summary

"Remember me" checkbox during user log in is a common practice currently does not supported by implementations of ServerSideSessionBackend / ClientSideSessionBackend classes.

Basic Example

    def set_session(self, value: dict[str, Any] | DataContainerType | EmptyType) -> None:
        """Set the session in the connection's ``Scope``.

        If the :class:`SessionMiddleware <.middleware.session.base.SessionMiddleware>` is enabled, the session will be added
        to the response as a cookie header.

        Args:
            value: Dictionary or pydantic model instance for the session data.

        Returns:
            None
        """
        self.scope["session"] = value

I think the best way would be to add ability to set specific cookie params in 'set_session' method, they would be used over default ones specified in SessionAuth instance. Then add support for it for ServerSideSessionBackend / ClientSideSessionBackend.

Drawbacks and Impact

Need to be careful about backward compability but i think there should not be much of a problem.

Unresolved questions

No response


Note

While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.
Fund with Polar
@Rey092 Rey092 added the Enhancement This is a new feature or request label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request
Projects
None yet
Development

No branches or pull requests

1 participant