I'm trying to understand sessions and authentication.
I gathered that the only way of preserving data across script
invocations was to use a session. However I note that
$_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are also preserved
across invocations and even from one script to another. How does this
work? (Are they repeatedly sent from the browser every time? If so, what
stops a site author from collecting a user name and password originally
entered for another site?) And how does one log off a user after
x minutes of inactivity?
If this is an RTFM question, I'd be happy with a pointer to the
appropriate bit of the M - I haven't managed to track it down so far.
I also note that $_SERVER contains entries which seem to have nothing to
do with the server, such as HTTP_USER_AGENT . Is there some logic here,
or is this just one of the historical accidents to which the IT world
seems so prone?
--
Stephen Poley
Barendrecht, Holland
I gathered that the only way of preserving data across script
invocations was to use a session. However I note that
$_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] are also preserved
across invocations and even from one script to another. How does this
work? (Are they repeatedly sent from the browser every time? If so, what
stops a site author from collecting a user name and password originally
entered for another site?) And how does one log off a user after
x minutes of inactivity?
If this is an RTFM question, I'd be happy with a pointer to the
appropriate bit of the M - I haven't managed to track it down so far.
I also note that $_SERVER contains entries which seem to have nothing to
do with the server, such as HTTP_USER_AGENT . Is there some logic here,
or is this just one of the historical accidents to which the IT world
seems so prone?
--
Stephen Poley
Barendrecht, Holland
Comment