3 Replies Latest reply on May 12, 2006 1:36 AM by DJ_Jamba

    HTTP or HTTPS?

    DJ_Jamba
      i'm trying to find a way to determine whether the current browser is runing over secure or not. I can't find anything that will detect the first part of the URL:
      http:// or https://
      but I can find everything after that!

      I'm wondering if it's possible to interrogate IIS port number to see if the page is OR isn't running over port 80.

      Any suggestions appreciated

      )

      jam
        • 1. Re: HTTP or HTTPS?
          JMGibson3 Level 1
          try <cfoutput>#cgi.server_port# and #cgi.server_port_secure#</cfoutput> I only run http and always/only see 80 and 0. I'd hope they'd change to 443 and 1 when https but have no way to test. Also CGI.HTTP_Referer begins with http but that's only where they started not what they clicked, might be a help though once in to https mode. You might also want to <cfdump var="#cgi#>. I think I recall there are other cgi's that cf doesn't display at the bottom when debug is turned on.
          • 2. Re: HTTP or HTTPS?
            Kronin555 Level 1
            There's cgi.HTTPS, which should be either ON or OFF.

            There's also cgi.SERVER_PORT which, for a default https site, is 443 and cgi.SERVER_PORT_SECURE which is either 1 (yes) or 0 (no).
            • 3. Re: HTTP or HTTPS?
              DJ_Jamba Level 1
              Thanks Guys
              All suggestions worked!
              Now seeing as you both replied within 2 minutes of each other - i'm marking the response as tied!

              Thanks very much!