When is the Django session key generated in a Django web application? More precisely I don't use Django authentication system. I use an external system. I check whether a session id is present for authentication of new tab. If already exist, application will be loaded in the new tab. Else authentication process will take place. But it always show that a key is present(generated precisely). I want to know which is the exact point where the session id or key is generated(Eg: in session middleware)
Asked
Active
Viewed 135 times
0
-
Not sure about what you need. It "happens" here:https://github.com/django/django/blob/master/django/contrib/sessions/middleware.py#L58 But for the rest, it'll depend on your backend. If "db" is used, you might want to have a look over here: https://github.com/django/django/blob/master/django/contrib/sessions/backends/db.py#L80 – Julien Kieffer Dec 09 '19 at 12:30
-
A session is not related to whether or not a user is logged in. Anonymous users can also have a session. Maybe you should set specific session key and check whether that exists rather than checking for a session. – dirkgroten Dec 09 '19 at 14:04
-
My scenario is that I don't use Django authentication system. I use an external system. I want to use custom session middleware instead of session middleware/app. What should I do? – Srinath NM Dec 10 '19 at 06:15