14.11.3. Discussion
SSL operates on a lower level than HTTP. The web server and a browser
negotiate an appropriately secure connection, based on their
capabilities, and the HTTP messages can pass over that secure
connection. To an attacker intercepting the traffic,
it's just a stream of nonsense bytes that
can't be read.
Different web servers have different requirements to use SSL, so
check your server's documentation for specific
details. No changes have to be made to PHP to work over SSL.
/* set an SSL-only cookie named "sslonly" with value "yes" that expires
* at the end of the current browser session */
setcookie('sslonly','yes','','/','sklar.com',1);
Although the browser sends these cookies back to the server only over
an SSL connection, the server sends them to the browser (when you
call setcookie( ) in your page) whether or not the
request for the page that sets the cookie is over SSL. If
you're putting sensitive data in the cookie, make
sure that you set the cookie only in an SSL request as well. Keep in
mind as well that the cookie data is unencrypted on the
user's computer.