starsessions
starsessions copied to clipboard
starsessions 2.0
What I'd like to see in the next release:
- automatic session loading (probably via
loop.run_until_complete
) - move serializers to middleware (now they are in backends)
- require explicit backend and remove
secret_key
from middleware arguments - ability to encrypt session contents, this is mandatory when using shared Redis instances
-
regenerate_id
should be a utility function, not a part ofSession
class because this makes mypy sad:request.session.regenerate_id()
vsnew_id = regenerate_id(request.session)
- cleanup
Session
class interface: consider removing all non-mapping methods from it, they are not compatible with Starlette's session interface - change
Backend.write
signature toasync def write(self, session_id: str, data: typing.Dict) -> str
, session_id to be required
Anything else?