Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing CFLOGIN Vars

Status
Not open for further replies.

metaphiz

Programmer
Jun 30, 2004
91
0
0
US
I've got a basic CFLOGIN framework going to secure an application. Everything is working fine, except after they log in I need to query a database for to pull info for each user. I used to use session variables, set in the login script, to do this.

I'd like to user cflogin.name and cflogin.password to identify the correct DB record. But the Adobe documentation says "You can use these values in the cflogin tag body to authenticate the user, and, in the cfloginuser tag, to log the user in. The structure is only available in the cflogin tag body."

This seems like it defeats the point of using CFLOGIN, since the code between <cflogin> and </cflogin> only executes when a user IS NOT logged in. Does this mean that upon entering the correct user/pass, I have to also set a session variable to identify the user outside of the CFLOGIN tag? It seems redundant...

Anyone have an explanation/solution? Below is my query and error.

THANKS!

<cfquery datasource="DS" name="QName" username="username" password="password">
SELECT *
FROM table
WHERE username = #cflogin.name#
</CFQUERY>

Error: Element NAME is undefined in CFLOGIN.
 
Yes, please use session vars to store logged in user info.

ColdFusion Ninja for hire.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top