Re: [squid-users] Getting authenticated username with PHP ?

From: Henrik Nordstrom <[email protected]>
Date: Mon, 5 Jan 2004 09:55:26 +0100 (CET)

On Mon, 5 Jan 2004, Andrew Nelson wrote:

> I have a squid cache that makes people authenticate... I'd like to set up
> PHP page that displays some information about the person logged in
> based on the username they are using..

Then you need to forward the login information to your PHP page. The
easiest way is by using a redirector which adds the login with a dummy
password to the URL using the syntax
  http://login:dummypassword@host/path/to/yourpage.php

or if you are running squid as an accelerator then see the cache_peer
login= option.

> Is there any way to list all the users who are currently logged in ?

There is no such thing as "users who are currently logged in" in HTTP.
HTTP is stateless and each and every request is authenticated separately.

It is the browser who maintains a session by reusing the same
login+password to avoid having to ask the user for login+password on each
and every request.

Regards
Henrik
Received on Mon Jan 05 2004 - 01:55:30 MST

This archive was generated by hypermail pre-2.1.9 : Sun Feb 01 2004 - 12:00:03 MST