On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović <mmmilovanovic...@gmail.com> wrote: > I want to logout a user from application when the application tab is closed.
the browser doesn't notify the server when the tab (or window) is closed. remember that the original web architecture was simply about downloading HTML documents and showing to the user. Once the download has happened, we're done with the server. the whole concept of "web application" is javascript running in the context of a web page, so you need the application itself (not the browser) to notify the server. You can use the "on-unload" event; for example with jQuery's .unload() event hook. Note that this event fires every time the page is unloaded, not only when the window or tab is closed, but also if the user navigates to another page (either via the URL bar or by clicking any link), uses the 'back' or 'forward' buttons, or even when reloading. that's why most web applications rely on timeout and not on trying to detect the user leaving the application. -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFkDaoQumw7hWa6DKL-WTAx%2BLyjWciMCgxuBDyC2H5HB_kBGdw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.