How to create a session using Fastapi so when a user login we can use it's id for multipurpose. I mean we can fetch id from session only

Question:

I want to create a session in fast API to get data from cookies.

Asked By: Rohit Mishra

||

Answers:

API stops being API when you use sessions.
You can use JWT authentication in this case, not session.
Otherwise you’d best build websocket architecture.
See official FastAPI docs https://fastapi.tiangolo.com/advanced/websockets/

Answered By: mr. Wayfarer
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.