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!

User Logon authentication 1

Status
Not open for further replies.

twhite5262

IS-IT--Management
Mar 10, 2001
6
0
0
US
What would be the best way to create a user/password logon authentication page that validates an Oracle user , then passes the username in subsequent cfquery.
Thanks , Im new to CF and just getting started .


 
Just bounce their login info against what is stored in the database, then you can use session variables to store their login info to be used throughout their session.

For example the following code could be invoked when the user has entered his/her username and password on a form. The info. would be passed to the code below:
Code:
<CFQUERY NAME=&quot;get_login&quot; DATASOURCE=&quot;your_database&quot;>
   SELECT username, password
   FROM my_db
   WHERE username = '#FORM.username#'
      AND password = '#FORM.password#'
</CFQUERY>

<CFIF get_login.RecordCount IS 0>
   The user was not in the database.  Code some error 
   handling here...
</CFIF>

<CFOUTPUT QUERY=&quot;get_login&quot;>
   <CFSET session.user = #username#>
   <CFSET session.password = #password#>
</CFOUTPUT>

<CFLOCATION URL=&quot;nextpage.cfm&quot;>

I don't think my way is necessarily the best. There are some obvious security issues involved with having passwords as session variables, but this works. Experiment with it a little. Try different methods and you'll get the hang of it pretty quick.

Good luck and make sure to listen to everyone who replies to this because there are some real wiz kids out there who really know their stuff! Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top