Django, Python: How do I know if users have closed their browser without click logout?
Really seriously question, because I need to analyse the user activities.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
it something to not do , but you can do something similar to Gmail (the way that they track if a user is still connected or not) you can do an AJAX request each 10 second or so (max time that will take a page to be loaded so that you don’t mistake changing page to disconnection) , this Ajax request is like a “i’m still here” when it’s received by the view
it reset a timer ( this timer have been initialized for each user from the beginning ) to 0 otherwise if this timer exceed 10 s , you can say that the user “is gone without disconnecting”.
you can pull also another way using comet (reverse Ajax) lcheck Orbited.
by the way disconnecting can me more than one thing : click on a disconnect link, remove session cookies , close page …