Can you clarify the scenario, please? What do you mean by "a user without access to request object"? Users don't have access to requests. A request either has a user associated or does not.
Regarding sessions, if the user doesn't already have a session—located via cookie—how will you know which user to perform actions for? If you are writing custom views, the login_required decorator/mixin <https://docs.djangoproject.com/en/1.11/topics/auth/default/#django.contrib.auth.decorators.login_required> is probably what you are seeking. Clinton On Monday, December 11, 2017 at 2:44:49 AM UTC-5, Bhaskar rao wrote: > > Session engine actually set to cache, so django_session is empty. > > Anyway, to get session key without knowing request object. > > On Monday, December 11, 2017 at 1:05:41 PM UTC+5:30, Bhaskar rao wrote: >> >> Hello, >> >> I want to force logout a user without access to request object. >> >> For this I tried to get session from user, so I tried >> Session.objects.all(). >> >> Its empty, even in the db, django_session table is empty. >> >> So, any thoughts on how to do this ? >> > -- You received this message because you are subscribed to the Google Groups "General Open edX discussion" group. To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/0f8b0a8c-417f-45bf-9f8c-8f4ccb059ce4%40googlegroups.com.
