Whatever message this page gives is out now! Go check it out!
<cflogin
applicationToken = "token"
cookieDomain = "domain"
idletimeout = "value"
allowconcurrent = "true|false"
usebasicauth = "true|false">
...
<cfloginuser
name = "name"
password = "password"
roles = "roles">
</cflogin>Attribute | Req/Opt | Default | Description |
applicationtoken | Optional | The current application name | The login that applies to the application. To let users log in to only one application, specify a unique value for that application. To let users log in to multiple applications, specify the same value for those applications. If you do not set a value for the applicationtoken attribute, the default value is CFAUTHORIZATION_applicationname. |
cookiedomain | Optional | Domain of the cookie that is used to mark a user as logged in. Use this attribute to enable a user login cookie to work with multiple clustered servers in the same domain. | |
idletimeout | Optional | 1800 | Time interval, in seconds, after which ColdFusion logs off the user. |
| allowconcurrent | Optional | true | If concurrent login sessions should be allowed. |
| usebasicauth | Optional | true | If basic authentication should be used to validate the login. |
<cflogin>
<cfif NOT IsDefined("cflogin")>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfif cflogin.name eq "admin">
<cfset roles = "user,admin">
<cfelse>
<cfset roles = "user">
</cfif>
<cfloginuser name = "#cflogin.name#" password = "#cflogin.password#"
roles = "#roles#"/>
</cfif>
</cflogin><cfquery name="qSecurity"
datasource="UserRolesDb">
SELECT Roles FROM SecurityRoles
WHERE username=<cfqueryparam value='#cflogin.name#' CFSQLTYPE="CF_SQL_VARCHAR"
AND password=<cfqueryparam value='#cflogin.password#' CFSQLTYPE='CF_SQL_VARCHAR'
</cfquery>
<cfif qSecurity.recordcount gt 0>
<cfloginuser name = "#cflogin.name#"
password = "#cflogin.password#"
roles = "#trim(qSecurity.Roles)#" >
</cfif>