Determining If the Page Is Viewed on a Secure Protocol
The easiest way to determine if a page is being viewed from a secured location on the server is to look at the location.protocol value. This value will be http on regular requests or https on secure requests.
With Safari, you learn the way you learn best. Get unlimited access to videos, live online training,
learning paths, books, interactive tutorials, and more.