Re: Log out all sessions for current user logged in

2021-03-01 Thread Ryan Nowakowski
You might need to call get_decoded then flush on that. https://docs.djangoproject.com/en/3.1/topics/http/sessions/ On February 28, 2021 11:48:51 PM CST, Salima Begum wrote: >New code for logging out all sessions of logged in users. > >``` > ># Logout all devices in account security page. >def l

Re: Log out all sessions for current user logged in

2021-02-28 Thread Salima Begum
New code for logging out all sessions of logged in users. ``` # Logout all devices in account security page. def logoff_all(request): try: # Filtering all session objects. session_query = Session.objects.all() # Iterating session_query and fetching session key.

Re: Log out all sessions for current user logged in

2021-02-27 Thread Ryan Nowakowski
Please reply with your new code and copy and paste the exact error message with full traceback. On February 26, 2021 6:40:28 PM CST, Salima Begum wrote: >Yes. I have tried that no it is not working and giving error like >"Query >object doesn't contain flush()" > >On Sat, 27 Feb 2021, 12:35 am R

Re: Log out all sessions for current user logged in

2021-02-26 Thread Salima Begum
Yes. I have tried that no it is not working and giving error like "Query object doesn't contain flush()" On Sat, 27 Feb 2021, 12:35 am Ryan Nowakowski, wrote: > Have your tried my suggestion below? Did it work? > > On February 25, 2021 9:42:55 PM CST, Salima Begum < > salim...@rohteksolutions.co

Re: Log out all sessions for current user logged in

2021-02-26 Thread Ryan Nowakowski
Have your tried my suggestion below? Did it work? On February 25, 2021 9:42:55 PM CST, Salima Begum wrote: >Logout all sessions belong to logged in user Can you please how can I >achieve this? > >Thanks >~salima > >On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski >wrote: > >> On Wed, Feb 17, 202

Re: Log out all sessions for current user logged in

2021-02-25 Thread Salima Begum
Logout all sessions belong to logged in user Can you please how can I achieve this? Thanks ~salima On Fri, Feb 26, 2021 at 4:56 AM Ryan Nowakowski wrote: > On Wed, Feb 17, 2021 at 08:23:08AM +0530, Salima Begum wrote: > > Logout all sessions based on current user id and clear django sessions >

Re: Log out all sessions for current user logged in

2021-02-25 Thread Ryan Nowakowski
On Wed, Feb 17, 2021 at 08:23:08AM +0530, Salima Begum wrote: > Logout all sessions based on current user id and clear django sessions > table based on user id. It is logging off all sessions. > > ``` > # Logout all devices in account security page. > def logoff_all(request): > try: > >