$_SERVER['HTTPS'] - undocumented feature?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi All,

I've seen many references to the $_SERVER['HTTPS'] variable, which is set to
the string 'on' when the client is connected via HTTPS rather than regular
HTTP.  However, I have been unable to find any references to it in the
official PHP documentation (many times in the user contributed notes,

Often, undocumented features go away with future releases, since "nobody
should have been using them anyway," etc.  For this reason I am concerned
about using this variable in order to determine if the client is connected
via HTTPS.  Is there a better way?  Or should I not be concerned about the
variable disappearing/getting renamed?


Re: $_SERVER['HTTPS'] - undocumented feature?

*** Joshua Beall wrote/escribió (Mon, 15 Nov 2004 18:16:34 GMT):
Quoted text here. Click to load it

These environment variables are created by the SSL module:


-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions

Re: $_SERVER['HTTPS'] - undocumented feature?

Quoted text here. Click to load it

$_SERVER entries are set by the web server. The HTTPS element is set by
Apache modssl. You can find that documented here
(http://www.modssl.org/docs/2.8/ssl_reference.html#ToC25 ) which I found by
looking in the notes attached to the $_SERVER variable documentation at

 - Virgil

Re: $_SERVER['HTTPS'] - undocumented feature?

Dear sir,

https means if your host is a secure server, not the client is connected via
https. it is not undocumented and it is visible in the phpinfo().
$_SERVER['HTTPS'] merely mentions if the server is secure or not and
effectively you can use the server as a secure server.

people do use it and it is an important function. otherwise they would not
have it there.

i think if variables disappear, they are not needed in the first place. at
this moment, i do not think it is any reason to panic.

thanking you

sumeet shroff

Quoted text here. Click to load it

Site Timeline