View comments | RSS feed
Contents > CFML Reference > ColdFusion Functions > GetAuthUser PreviousNext

GetAuthUser

Gets the name of an authenticated user.

The name of an authenticated user.

Authentication functions

GetAuthUser()

IsUserInRole, cflogin, cfloginuser, Securing Applications in Developing ColdFusion MX Applications

ColdFusion MX: Added this function.

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).

<H3>GetAuthUser Example</H3>

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

Contents > CFML Reference > ColdFusion Functions > GetAuthUser PreviousNext

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

Version 6.1

Comments are no longer accepted for ColdFusion MX 6.1. ColdFusion 8 is the current version.

Comments


No screen name said on Oct 6, 2003 at 12:26 AM :
coldfusion 6.1 regerence> GetAuthUser()

you forgot to up # around the example

<cfoutput>GetAuthUser()</cfoutput>
Sarge said on Mar 20, 2004 at 9:42 AM :
Suggest modifying the example to add # around GetAuthUser() call:
<P>Authenticated User: <cfoutput>#GetAuthUser()#</cfoutput>
GAlanShepherd said on May 31, 2004 at 8:09 AM :
I cant get "GetAuthUser()" to work - it seems to continually contain the empty string, even though the user is apparently logged in as the code in <cflogin> does not get executed a second time...

Also, if you put <cfoutput>GetAuthUser()</cfoutput> as the document suggests, you get GetAuthUser() on the screen! Surely you need <cfoutput>#GetAuthUser()#</cfoutput>
halL said on Jun 1, 2004 at 8:25 AM :
GAlanShepherd is correct that the example is missing # signs.
The corrected line is:
<P>Authenticated User: <cfoutput>#GetAuthUser()#</cfoutput>
DrMatt said on Aug 24, 2004 at 10:29 AM :
I find consistently that the value of GetAuthUser() is retained for a fixed number of milliseconds, typically 250, no matter what the application settings are. Per other comments on this thread, it reverts quickly to "", and does not maintain its state throughout Session, no matter what the documentation says. To track state, you need to set and clear your own Session variable just after the cfloginuser and cflogout tags.
dmbolash said on Dec 6, 2004 at 4:44 AM :
I can get Get AuthUser() to work as expected on my test server, which is version 6,1,0,63958; however, the remote server is version 6.0 and I get the same results as DrMatt. Was this issue addressed and fixed in MX 6.1?

 

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

Current page: http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi86.htm