Copy link to clipboard
Copied
is there a way to check if a page on my site was requested with HTTP or HTTPS ?
I only want to respond if I know the page was requested as:
https://www.mysite.com/mypage.cfm ?
Copy link to clipboard
Copied
You can look in the CGI scope to find this and many other things. These may slightly vary from one server to another, as they're dependent on web server software, but there's one called CGI.HTTPS and another called CGI.SERVER_PORT.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/
Copy link to clipboard
Copied
I couldn't find anything on the Coldfusion forum, but I've managed to find something on House Of Fusion.
Would the following be correct ?
<cfif #cgi.server_port_secure# EQ 1>
HTTPS
<cfelse>
HTTP
</cfif>
expanding it further, is the following also valid ?
<cfif #cgi.server_port_secure# EQ 1 AND structKeyExists (form,"password")>
HTTPS
<cfelse>
HTTP
</cfif>
Copy link to clipboard
Copied
Better:
HTTP
</cfif