IsSecureSite([localServers])
Last updated February 17, 2004
Version: 1 | Requires: ColdFusion 5 | Library: SecurityLib
Description:
It checks to see if the code is on a SSL site by checking the value of CGI.Server_Port_Secure. You can also pass a list of servers to the UDF so you can use your code on a listed sever, local and development servers.
Return Values:
Returns a boolean.
Example:
<cflocation url="#Request.WebPath.SecureDomain#index.cfm">
</cfif>
Parameters:
| Name | Description | Required |
|---|---|---|
| localServers | If the current server matches one of the servers in this list, the UDF will return true. Defaults to an empty string. | No |
Full UDF Source:
<cfscript>
/**
* Checks to see if the current page is being run on a secure server.
*
* @param localServers If the current server matches one of the servers in this list, the UDF will return true. Defaults to an empty string. (Optional)
* @return Returns a boolean.
* @author Mike Hughes (mike@gne-ws.com)
* @version 1, February 17, 2004
*/
function IsSecureSite() {
if(arrayLen(arguments)) localServers = arguments[1];
if(cgi.server_port_secure OR listFindNoCase(localServers, cgi.server_name)) return true;
else return false;
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
11 day(s) ago
Will Belden added
longTime
17 day(s) ago
James Sleeman added
quickSort
27 day(s) ago
Ben Forta added
GetHostAddress
29 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)