On 7/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Is there a way to find currently active sessions, out of all sessions
> stored in the database?
> Say I want to put a "users currently active" box on my page (*), how
> would I do that. I've had a look at the session model but didn't find
> anything that looked as if it would help. I'm using persistent
> sessions, so that users do not have to log in each time.

Hey Daniel,

This would be inexact, but you could look in the django_session table
for all records with an expire_date in a particular date range. That's
the only date/time information we store for sessions, so I'm afraid
that's the only solution I can think of.

    from django.contrib.sessions.models import Session
    Session.objects.filter(expire_date__gt=xxx)

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to