User Guide Cancel

IsUserLoggedIn

 

Description

Determines whether a user is logged in.

Returns

True, if the user, is logged in; False, otherwise.

Category

Function syntax

IsUserLoggedIn()
IsUserLoggedIn()
IsUserLoggedIn()

See also

cflogincfloginuserGetAuthUserGetUserRolesIsUserInAnyRoleIsUserInRoleSecuring Applications in the Developing ColdFusion Applications

History

ColdFusion 8: Added this function.

Example

<cfif IsUserLoggedIn() >
<cfinclude template="welcome.cfm">
<cfelse>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
<cfif IsUserLoggedIn() > <cfinclude template="welcome.cfm"> <cfelse> <cfinclude template="loginform.cfm"> <cfabort> </cfif>
<cfif IsUserLoggedIn() > 
<cfinclude template="welcome.cfm"> 
<cfelse> 
<cfinclude template="loginform.cfm"> 
<cfabort> 
</cfif>
Note:

From ColdFusion 11 onwards, this function is not applicable when a user is logged in using Admin API. 

Get help faster and easier

New user?