[Zope] Re: tag for knowing how many have logged under the same URL (present time)

Dieter Maurer dieter@handshake.de
Tue, 21 Nov 2000 21:56:23 +0100 (CET)


jacintha menezes writes:
 >      Kindly let me know how can we find out how many have logged (present
 > time)into zope
 > under the same URl.If there is an dtml-tag for this kindly give me that.
Obviously, you do not know yet how logging in works:

  HTTP is a stateless protocol.
  There is not such concept "currently being logged in".
  Zope does not know, who is or how many are currently "logged in".

  Instead, Zopes sees a sequence of requests, all independent
  from one another (from Zope's point of view).
  Some requests contain authentication information.
  You probably tend to say, that these requests are
  requests from logged in users.

  However, the authentication information is maintained
  by the browser. Zope has not information whatsoever
  about when the browser drops the authentication
  information (user logs off), e.g. because the browser
  is terminated. It therefore cannot tell, who
  currently is logged in.


There is a cookie based authentication.
For this form, there usually is a session/user record for logged
in users on the server. The cookie identifies the associated
session/user record. Again, Zope does not know, when the
browser drops the cookie (user logs off), but it can
force log off with an inactivity timeout.
When the user does not access Zope for a specific time,
it deletes the session/user record.
When the cookie still exists, the next request using this
record will require a new log in.
With this authentication form, you can *estimate* the
number of logged in users by counting the current session/user records.


Dieter