While using a session in your Django projects, if the user who logs out is using Firefox, it still appears in the session.
To fix this problem, we can write a custom logout function.
urls.py
from django.contrib.auth import logout
from django.shortcuts import redirect
from django.urls import path, includedef exit_yap(request): for sesskey in list(request.session.keys()):
print(request.session[sesskey])
del request.session[sesskey] logout(request)
return redirect('/admin/')
urlpatterns = [
path('', homepage),
path('admin/logout/', logout_do),
path('admin/', admin.site.urls),
]
You have examined the knowledge base in detail, but if you cannot find the information you need,
Create a Support Ticket