alex-oleshkevich / starsessions

Advanced sessions for Starlette and FastAPI frameworks
MIT License
94 stars 11 forks source link

Added null checks for session_id in redis store #54

Closed RamiAwar closed 1 year ago

RamiAwar commented 1 year ago

Redis store might get a session_id of None, which would break the prefix function that wraps session_id in all the store's methods.

Closes #22

alex-oleshkevich commented 1 year ago

This is obsolete as the handler won't load the session if session id is falsy. See https://github.com/alex-oleshkevich/starsessions/blob/d45bf2ecc69ff84718fc60e9b7dce3a5b3117dec/starsessions/session.py#L108

Also, it will generate a new session id for write method if session id is empty. https://github.com/alex-oleshkevich/starsessions/blob/d45bf2ecc69ff84718fc60e9b7dce3a5b3117dec/starsessions/session.py#L131