Re: Logout user on tab closing

2015-05-19 Thread Thorsten Sanders
I wouldnt do that at all, lets take ebay as an example when I use that I 
have several tabs at the same time open and it would be really annoying 
if I get a logout if I close one of those tabs and the same is true for 
many other sites.


Same is true for my bank too, they just do a logout if I dont do any 
action for 12m thats the better way if security matters and if on tab 
close, there should be maybe some sort of popup asking if you want to 
logout.


Am 19.05.2015 15:54, schrieb Javier Guerra Giraldez:

On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović
 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.



--
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/555B8475.30105%40gmx.net.
For more options, visit https://groups.google.com/d/optout.


Re: Logout user on tab closing

2015-05-19 Thread Gergely Polonkai
Well, onunload can be used if you are creating a one-page app, e.g. by
using AngularJS. With multipage apps, this is of no use.
On 19 May 2015 16:54, "Javier Guerra Giraldez"  wrote:

> On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović
>  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.
>

-- 
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/CACczBULmFuvg8NqL%3DZ147cyy1g9TM1eMEekbuZmysGQXbDmrmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Logout user on tab closing

2015-05-19 Thread Javier Guerra Giraldez
On Tue, May 19, 2015 at 8:23 AM, Miloš Milovanović
 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.