I'm developing a CakePHP site for which I've just enabled VAS authentication using a .htaccess file:
AuthType VAS
AuthVasUseBasic On
AuthVasRemoteUserMap local
Require valid-user
I'd expect to be able to find out who was logged in by using $_SERVER['REMOTE_USER']
, but I'm finding that the key is missing from the $_SERVER
structure: all that's there is $_SERVER['REDIRECT_REMOTE_USER']
. In fact, the whole structure is full of keys with the REDIRECT_
prefix:
echo var_dump($_SERVER);
array(52) {
["REDIRECT_REDIRECT_REDIRECT_SCRIPT_URL"]=> string(37) "/cake_1_2/feedbacks/edit/6"
["REDIRECT_REDIRECT_REDIRECT_SCRIPT_URI"]=> string(55) "http://test/cake_1_2/feedbacks/edit/6"
["REDIRECT_REDIRECT_REDIRECT_STATUS"]=> string(3) "200"
["REDIRECT_REDIRECT_SCRIPT_URL"]=> string(37) "/cake_1_2/feedbacks/edit/6"
["REDIRECT_REDIRECT_SCRIPT_URI"]=> string(55) "http://test/cake_1_2/feedbacks/edit/6"
["REDIRECT_REDIRECT_STATUS"]=> string(3) "200"
["REDIRECT_SCRIPT_URL"]=> string(37) "/cake_1_2/feedbacks/edit/6"
["REDIRECT_SCRIPT_URI"]=> string(55) "http://test/cake_1_2/feedbacks/edit/6"
["REDIRECT_HANDLER"]=> string(8) "php5-cgi"
["REDIRECT_STATUS"]=> string(3) "200"
["SCRIPT_URL"]=> string(37) ...
["REDIRECT_REMOTE_USER"]=> string(9) "andygeers"
...
}
I'm not exactly sure what's going on! This is generated first thing in a POST request, and it's not doing a redirect on this particular request.
Is this related to CakePHP, or just a general PHP issue? Any ideas what's going on? I've found quite a few pages on the internet now which suggest REDIRECT_REMOTE_USER is normal/common as a place to find this value, but nobody seems to know why!