|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
login prob
I keep getting this error but I don't understand whats wrong with myMike Miessen 01/06/03 10:15 P Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbnameJohn Wilker 01/06/03 10:26 P MX is what I am usingMike Miessen 01/06/03 10:30 P You would be better of assigning values like dbtype, sql, username,Tilbrook, Peter 01/06/03 10:31 P Well I took that out of my tag and it does not error but now it does notMike Miessen 01/06/03 10:40 P If you have a DSN already set up (I asusme you do and it's called users)John Wilker 01/06/03 10:49 P Well that didn't change anything. I got this from the easycfm.comMike Miessen 01/06/03 11:14 P Well I got some of my problems solved. Mostly it was a directoryMike Miessen 01/07/03 12:19 A What happens? Nothing or you get put to the login page?John Wilker 01/07/03 12:40 A I have the login page and the login process page in my root dir. TheyMike Miessen 01/07/03 12:49 A Try and drop some <CFOUTPUT> into the code. Or run the app in debug soJohn Wilker 01/07/03 01:09 A I put CFOUTPUT just after the CFSET stmt and indeed the variableMike Miessen 01/07/03 10:02 A The problem he was experiencing was with this:Pablo Varando 01/07/03 07:58 P Um, crazy question, but what happens if a user hits your site w/Raymond Camden 01/08/03 10:42 A I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users MX is what I am using Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users You would be better of assigning values like dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug when setting up the Datasource initially (in ODBC and under CF Admin). At least that way you can avoid hardcoding settings like "username" and "password" in your code. You really only need the "dbtype" if you are, say developing under Microsoft Access (the setting would then be MSACCESS) and using something like SQL Server in the production environment (the setting would then be MSSQL) - or catering for both or more than one (the SQL required to say create tables under Access is not the same as MSSQL or MySQL). Most of the attributes you are using you never require unless you are specifically using a database specific feature or a ColdFusion specific feature (eg: caching of queries). Try changing you CFQUERY tag to this: <cfquery name="qVerify" datasource="#DataSourceName#"> I think you're using your datasource name as the Database name instead of the actuall datasource setup in ODBC/CF Admin. == Peter Tilbrook Project Officer Strategic Development Australian Building Codes Board GPO Box 9839 CANBERRA ACT 2601 AUSTRALIA WWW: http://www.abcb.gov.au/ E-Mail: peter.tilbrook@abcb.gov.au Telephone: (02) 6213 6731 Mobile: 0439 401 823 Facsimile: (02) 6213 7287 I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users Well I got some of my problems solved. Mostly it was a directory structure problem. My current problem is that I get logged in and then when it goes to the membersonly directory it runs a cfm page there where I have an application.cfm file with the following code. The problem is that the variable session.allowin does not seem to be set because it blocks me when it checks that in the cfif statement. The process page says I successfully logged in and then when I call the members page the application.cfm blocks me. Any ideas? <!--- Create the user login application ---> <cfapplication name="MyApp" clientmanagement="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#" applicationtimeout="#CreateTimeSpan(0,2,0,0)#"> <!--- Now define that this user is logged out by default ---> <CFPARAM NAME="session.allowin" DEFAULT="false"> <!--- Now if the variable "session.allowin" does not equal true, send user to the login page ---> <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call ---> <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/login.cfm"; </script> </cfif> </cfif> Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users What happens? Nothing or you get put to the login page? This chunk <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> ---You don't have anything happen here.--- <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> ---You don't have anything happen here.--- <cfelse> ... Do you set the session.allowin anywhere else prior to this page? Another application.cfm somwhere up the directory tree? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I got some of my problems solved. Mostly it was a directory structure problem. My current problem is that I get logged in and then when it goes to the membersonly directory it runs a cfm page there where I have an application.cfm file with the following code. The problem is that the variable session.allowin does not seem to be set because it blocks me when it checks that in the cfif statement. The process page says I successfully logged in and then when I call the members page the application.cfm blocks me. Any ideas? <!--- Create the user login application ---> <cfapplication name="MyApp" clientmanagement="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#" applicationtimeout="#CreateTimeSpan(0,2,0,0)#"> <!--- Now define that this user is logged out by default ---> <CFPARAM NAME="session.allowin" DEFAULT="false"> <!--- Now if the variable "session.allowin" does not equal true, send user to the login page ---> <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call ---> <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/login.cfm"; </script> </cfif> </cfif> Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users I have the login page and the login process page in my root dir. They are now working as designed. Login.cfm calls login_action.cfm which checks the database and allows if the username and password works. It sets session.allowin = true. Then it calls out to the members dir where the member page and the application.cfm is located. Well application.cfm sets session.allowin default to false but it should skip that because it is already set to true supposedly. So then the application.cfm blocks me and I don't know why What happens? Nothing or you get put to the login page? This chunk <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> ---You don't have anything happen here.--- <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> ---You don't have anything happen here.--- <cfelse> ... Do you set the session.allowin anywhere else prior to this page? Another application.cfm somwhere up the directory tree? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I got some of my problems solved. Mostly it was a directory structure problem. My current problem is that I get logged in and then when it goes to the membersonly directory it runs a cfm page there where I have an application.cfm file with the following code. The problem is that the variable session.allowin does not seem to be set because it blocks me when it checks that in the cfif statement. The process page says I successfully logged in and then when I call the members page the application.cfm blocks me. Any ideas? <!--- Create the user login application ---> <cfapplication name="MyApp" clientmanagement="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#" applicationtimeout="#CreateTimeSpan(0,2,0,0)#"> <!--- Now define that this user is logged out by default ---> <CFPARAM NAME="session.allowin" DEFAULT="false"> <!--- Now if the variable "session.allowin" does not equal true, send user to the login page ---> <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call ---> <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/login.cfm"; </script> </cfif> </cfif> Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users Try and drop some <CFOUTPUT> into the code. Or run the app in debug so you can watch SESSION.allowin my guess is a place you think is changing it, isn't. If I am not doing it in debug I put some script alert() to pop up the variables I want to watch. J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I have the login page and the login process page in my root dir. They are now working as designed. Login.cfm calls login_action.cfm which checks the database and allows if the username and password works. It sets session.allowin = true. Then it calls out to the members dir where the member page and the application.cfm is located. Well application.cfm sets session.allowin default to false but it should skip that because it is already set to true supposedly. So then the application.cfm blocks me and I don't know why What happens? Nothing or you get put to the login page? This chunk <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> ---You don't have anything happen here.--- <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> ---You don't have anything happen here.--- <cfelse> ... Do you set the session.allowin anywhere else prior to this page? Another application.cfm somwhere up the directory tree? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I got some of my problems solved. Mostly it was a directory structure problem. My current problem is that I get logged in and then when it goes to the membersonly directory it runs a cfm page there where I have an application.cfm file with the following code. The problem is that the variable session.allowin does not seem to be set because it blocks me when it checks that in the cfif statement. The process page says I successfully logged in and then when I call the members page the application.cfm blocks me. Any ideas? <!--- Create the user login application ---> <cfapplication name="MyApp" clientmanagement="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#" applicationtimeout="#CreateTimeSpan(0,2,0,0)#"> <!--- Now define that this user is logged out by default ---> <CFPARAM NAME="session.allowin" DEFAULT="false"> <!--- Now if the variable "session.allowin" does not equal true, send user to the login page ---> <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call ---> <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/login.cfm"; </script> </cfif> </cfif> Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users I put CFOUTPUT just after the CFSET stmt and indeed the variable session.allowin was set to true. I also put a CFOUTPUT at the top of my application.cfm and found session.allowin was false. So why is this variable becoming false before it gets to my application.cfm? Do I need to do something to pass the values to it? Try and drop some <CFOUTPUT> into the code. Or run the app in debug so you can watch SESSION.allowin my guess is a place you think is changing it, isn't. If I am not doing it in debug I put some script alert() to pop up the variables I want to watch. J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I have the login page and the login process page in my root dir. They are now working as designed. Login.cfm calls login_action.cfm which checks the database and allows if the username and password works. It sets session.allowin = true. Then it calls out to the members dir where the member page and the application.cfm is located. Well application.cfm sets session.allowin default to false but it should skip that because it is already set to true supposedly. So then the application.cfm blocks me and I don't know why What happens? Nothing or you get put to the login page? This chunk <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> ---You don't have anything happen here.--- <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> ---You don't have anything happen here.--- <cfelse> ... Do you set the session.allowin anywhere else prior to this page? Another application.cfm somwhere up the directory tree? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I got some of my problems solved. Mostly it was a directory structure problem. My current problem is that I get logged in and then when it goes to the membersonly directory it runs a cfm page there where I have an application.cfm file with the following code. The problem is that the variable session.allowin does not seem to be set because it blocks me when it checks that in the cfif statement. The process page says I successfully logged in and then when I call the members page the application.cfm blocks me. Any ideas? <!--- Create the user login application ---> <cfapplication name="MyApp" clientmanagement="Yes" sessionmanagement="Yes" sessiontimeout="#CreateTimeSpan(0,0,15,0)#" applicationtimeout="#CreateTimeSpan(0,2,0,0)#"> <!--- Now define that this user is logged out by default ---> <CFPARAM NAME="session.allowin" DEFAULT="false"> <!--- Now if the variable "session.allowin" does not equal true, send user to the login page ---> <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call ---> <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/login.cfm"> <cfelseif CGI.SCRIPT_NAME EQ "/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/login.cfm"; </script> </cfif> </cfif> Well that didn't change anything. I got this from the easycfm.com tutorial. Hey I thought this was easy LOL If you have a DSN already set up (I asusme you do and it's called users) try using just <CFQUERY Datasource="users" name="qVerify"> John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. Well I took that out of my tag and it does not error but now it does not seem to be checking the database table either because it is not passing me through I'm still trying to understand Peter's response LOL Have you tried taking dbname="#myDSN#" out of your tag? IIRC dbname isn't used anymore, I could be wrong there. I never use it. What CF version? J. John Wilker Web Applications Consultant, Writer Macromedia Certified ColdFusion Developer Founder/President IE CFUG www.red-omega.com Whatever is wrong it is better than a poke in the eye with a sharp stick. Unless of course you just got poked in the eye with a sharp stick. I keep getting this error but I don't understand whats wrong with my code can anybody tell me? The tag does not have an attribute called dbname. The valid attribute(s) are name, datasource, dbtype, sql, username, password, maxrows, blockfactor, timeout, cachedafter, cachedwithin, debug. The Error Occurred in D:\wwwroot\MembersOnly\Login_Process.cfm: line 9 7 : <body> 8 : <!--- Get all records from the database that match this users credentials ---> 9 : <cfquery name="qVerify" dbname="#myDSN#" datasource="Users" username="#DSNUsername#" password="#DSNPassword#"> 10 : SELECT UserName, Password 11 : FROM users The problem he was experiencing was with this: The problem is here: <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "login.cfm"> <cfabort> <cfelseif CGI.SCRIPT_NAME EQ "login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="login.cfm"; </script> </cfif> </cfif> It must be changed to: <cfif session.allowin neq "true"> <cfif CGI.SCRIPT_NAME EQ "/bluegrasspro/membersonly/login.cfm"> <cfabort> <cfelseif CGI.SCRIPT_NAME EQ "/bluegrasspro/membersonly/login_process.cfm"> <cfelse> <!--- this user is not logged in, alert user and redirect to the login.cfm page ---> <script> alert("You must login to access this area!"); self.location="/bluegrasspro/membersonly/login.cfm"; </script> </cfif> </cfif> This requires the web path to the login page as modified. The issue has been resolved :) Pablo ----- Excess quoted text cut - see Original Post for more ----- Um, crazy question, but what happens if a user hits your site w/ JavaScript turned off. Won't this security code completely break down? ======================================================================= Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc Email : jedimaster@mindseye.com WWW : www.camdenfamily.com/morpheus Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda ----- Excess quoted text cut - see Original Post for more -----
|
June 19, 2013
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||