django SessionAuthentication

Posted Almost 6 years ago. Visible to the public. Draft.

Overview

SessionAuthentication method: This method uses the session cookie (which is set through the normal Django login and logout views) to check out if there’s an authenticated user and get his username. This method works only in the same session (browser window) as the one that actually did the login but this should be enough for most cases.

After you log in with Django, your authentication information is saved to the “session”_. The session is a bucket of information that the Django application saves about your visit — to distinguish between different visitors a cookie with a unique value named sessionid will be used. So, your web browser will send this cookie with each page request thus allowing Django to know which bucket of information is yours (and if you’ve authenticated know who are you). This is not a Django related concept but a general one (supported by most if not all HTTP frameworks) and is used to add state to an otherwise stateless medium (HTTP).

https://spapas.github.io/2018/03/01/django-rest-auth/ Show archive.org snapshot

Cuauhtemoc
Last edit
Almost 6 years ago
Cuauhtemoc
Posted by Cuauhtemoc to Python Django (2018-07-02 20:37)