You can use jquery. you can write a function like logout (in the view)
after that when browser tab is closed (you have to check with jquery
code) you can kill user session. 

Prş, 2019-03-21 tarihinde 17:15 +0330 saatinde, Mohammad Etemaddar
yazdı:
> I have a suggest for you. Its non standard.
> 
> First create a javascript infinite loop to make a get call every 1
> minute.
> Also make session expiration time at 2 minutes. So if tabs closed the
> session will expire at 1 minute.
> 
> On Thu, 21 Mar 2019 15:17 Christian Ledermann, <
> christian.lederm...@gmail.com> wrote:
> > SESSION_EXPIRE_AT_BROWSER_CLOSE works for me 
> > but only when you close the browswer, closing a tab will not log
> > you out
> > also it depends on the browser (firefox seemed in the past to
> > ignore this)
> > 
> > On Thu, 21 Mar 2019 at 05:34, Sam W <samca...@gmail.com> wrote:
> > > Is there a way in Django to  log out a user when user closes tab
> > > or browser?
> > > 
> > > This one "SESSION_EXPIRE_AT_BROWSER_CLOSE =True" Doesn't work
> > > 
> > > -- 
> > > 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 https://groups.google.com/group/django-users.
> > > To view this discussion on the web visit 
> > > https://groups.google.com/d/msgid/django-users/644cca74-0443-4c71-8d8e-7326a252eb2e%40googlegroups.com
> > > .
> > > For more options, visit https://groups.google.com/d/optout.
> > 
> > 
> > -- 
> > Best Regards,
> > 
> > Christian Ledermann
> > 
> > Newark-on-Trent - UK
> > Mobile : +44 7474997517
> > 
> > https://uk.linkedin.com/in/christianledermann
> > https://github.com/cleder/
> > 
> > 
> > <*)))>{
> > 
> > If you save the living environment, the biodiversity that we have
> > left,
> > you will also automatically save the physical environment, too. But
> > If
> > you only save the physical environment, you will ultimately lose
> > both.
> > 
> > 1) Don’t drive species to extinction
> > 
> > 2) Don’t destroy a habitat that species rely on.
> > 
> > 3) Don’t change the climate in ways that will result in the above.
> > 
> > }<(((*>
-- 

Teşekkürler,
http://www.kadircebel.com 

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07d89baa005bb001a3c2b034b073264edd05c40c.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to