Hi,

That last login field only applies when user really logs in. (IOW you call login() function from django.contrib.auth). After that user is persisted to session so there is no need to authenticate per request.

Now if you have longer sessions than 24 hours user will stay logged in (I think default session TTL is 2 week after last modification). So that would still give troubles that users may have been active in last few seconds but not logged in for a few days.

On 09.12.2015 15:37, Jon Ribbens wrote:
On Wednesday, 9 December 2015 12:55:22 UTC, Jani Tiainen wrote:

    This is really problematic domain since as you know, Django works
    on HTTP request-response cycle. After cycle is finished there is
    absolutely no way to know "who is logged on".

    So first you have to determine factors that make up "currently
    active user". Then you have to track that information somehow and
    after that it's possible to gather a list of active/inactive users.


Users have a last_login field so you could easily say "users who have logged in in the last 24 hours" or whatever.
--
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 <mailto:django-users+unsubscr...@googlegroups.com>. To post to this group, send email to django-users@googlegroups.com <mailto: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/7c5f0620-c094-4667-b474-82a23f432fa1%40googlegroups.com <https://groups.google.com/d/msgid/django-users/7c5f0620-c094-4667-b474-82a23f432fa1%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--

Jani Tiainen

--
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/566944D0.9020204%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to