programmher
Programmer
I am assigning security levels to certain pages within my site.<br><br>The security is supposed to be determined after the user logs in on the welcome page. The login authentication is performed by the below code:<br><br><br><br>"<CFSET Session.LoggedIn = FALSE> <br><br><html><br><br><head><br><br> <title> Welcome - UserID Authenticate</title><br><br></head><br><br><cfquery name="LogginIn" datasource="MyDatabase" > SELECT *<br>FROM dbo.Users <br>WHERE (UserId = '#form.UserID#') AND (Password = '#form.password#')<br></cfquery><br><br> <cfif LogginIn.RecordCount GREATER THAN 0><br> <CFIF LogginIn.Password IS Form.Password><br> <CFSET Session.LoggedIn = TRUE> <br> <CFSet Session.UserID="#Form.UserID#"> <br><!--- <CFSet Session.Security="#Form.Security#"> ---><br> <CFSET Session.AddToken = "cfid=#cfid#&cftoken=#cftoken#"> <br> <br> <br> <CFELSE><br> <CFSET Reason = "The password you typed is invalid. Please Try again"> <br> <br></CFIF><br> <CFELSE><br><CFOUTPUT><br> <CFSET Reason = 'Can not find a user named #Form.UserID#'><br></CFOUTPUT><br><br></CFIF> <br><br><CFIF Session.LoggedIn><br><br><cflocation url="Home.cfm" addtoken="Yes"> <br> <br><br> <cfelse> <br> <CFOUTPUT><br><br> <Script><br> alert("Sorry! Your login was unsuccessful"<br> self.location="welcome.cfm";<br> </script><br> <br> </cfoutput> <br><br></cfif>"<br><br>Needless to say, when I refer to the Security session variable in my home.cfm page, I get an error. What am I missing? Why does my CF "read" the session variable before the session.security and the session variable after the session.security variable???<br><br><br><br><br><br>