Ok I think you need a basic breakdown of how this should work. Step 1: User goes to a section of your website/app that needs login. You check if the session.userid is set to a valid value. If not goto login screen.
Step 2: Present user with a login form.
<form action="checklogin.cfm"> <input type="text" name="username" value=""> <input type="password" name="pass" value=""> <input type="submit" value="login"> </form>
Step 3: On clicking login the form is submitted to an action page which checks if the credentials supplied match a valid user.
<cfquery datasource = "myDB" name = "getUsers"> SELECT userID FROM USERS WHERE username = <cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.username#" /> AND password = <cfqueryparam cfsqltype = "cf_sql_varchar" value = "#form.pass#" /> </cfquery>
Step 4: If valid user goto the logged in area else return to login screen
<cfif getUsers.recordCount GT 0> <cfset session.IDUsers = getUsers.userID /> <cflocation url="home page for logged in users"> <cfelse> <cflocation url="return to login form and display invalid login message"> </cfif>
This is a very basic login form but it should get you started.