Issue
I have a Python/Django app which sometimes has more than 100 users logged in. One day, I found this in Django error log:
The request's session was deleted before the request completed.
The user may have logged out in a concurrent request, for example.
Although the message is written in quite understandable English, I have no idea
- what actually happened
- why it happened
- whether I need to worry about it
- if yes, how can I prevent this from happening again
I found a question with almost same title but the difference is that I do not have anything about caching in my settings.
If you need any pieces of code, just please let me know in the comments.
Thanks for your time!
Solution
What actually happened: A user’s session was destroyed (i.e., they logged out, or the session expired) while the same user made a request with the same session key.
Why it happened: For example, it could happen if the user had two tabs open, and logged out in one of the tabs, while a request was also made from another tab. If both happened in quick succession then one would hit this error.
Do you need to worry about it?: Not unless you see lots of events like this in the logs, in which case there is something wrong. If you found the error just once, then it’s nothing to worry about.
Answered By – solarissmoke
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0