View comments | RSS feed

GetAuthUser

Description

Gets the name of an authenticated user.

Returns

The name of an authenticated user.

Category

Security functions

Function syntax

GetAuthUser()

See also

IsUserInRole, cflogin, cfloginuser; Securing Applications in ColdFusion MX Developer's Guide

History

ColdFusion MX: Added this function.

Usage

This function works with cflogin authentication or web server authentication. It checks for a logged-in user as follows:

  1. It checks for a login made with cfloginuser.
  2. If no user was logged in with cfloginuser, it checks for a web server login (cgi.remote_user).

Example

<H3>GetAuthUser Example</H3>

<P>Authenticated User: <cfoutput>#GetAuthUser()#</cfoutput>

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


.: |\/| :. said on Aug 22, 2005 at 10:11 AM :
What is returned if a user is not authenticated?
HorsePunchKid said on Sep 8, 2005 at 3:48 PM :
I have not tested thoroughly, but it appears that it just returns an empty string ("") if you have not logged in.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000469.htm