Forums

This topic is locked

Login always redirect to failed login page ??

Posted 13 Jun 2007 14:54:09
1
has voted
13 Jun 2007 14:54:09 Ann Lambin posted:
Hi there !

Using DWMX2004 with Coldfusion and Access 2003, I built a simple login page using the login server behavior, BUT.... I'm always redirected to the failed login page (even with a correct username and password) !
Any idea ???
I've also built another "new user" registration page with the user authentication server behavior and using the same table and it works perfectly fine.

I am puzzled... <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>(((

Thanks in advance for your help!
Here is the code of the login page:

&lt;cfif IsDefined("FORM.myEmail"&gt;
&lt;cfset MM_redirectLoginSuccess="login_ok.htm"&gt;
&lt;cfset MM_redirectLoginFailed="login_failed.htm"&gt;
&lt;cfquery name="MM_rsUser" datasource="Calliope"&gt;
SELECT UserEmail,UserPass FROM tblUsers WHERE UserEmail='#FORM.myEmail#' AND UserPass='#FORM.myPass#'
&lt;/cfquery&gt;
&lt;cfif MM_rsUser.RecordCount NEQ 0&gt;
&lt;cftry&gt;
&lt;cflock scope="Session" timeout="30" type="Exclusive"&gt;
&lt;cfset Session.MM_Username=FORM.myEmail&gt;
&lt;cfset Session.MM_UserAuthorization=""&gt;
&lt;/cflock&gt;
&lt;cfif IsDefined("URL.accessdenied" AND false&gt;
&lt;cfset MM_redirectLoginSuccess=URL.accessdenied&gt;
&lt;/cfif&gt;
&lt;cflocation url="#MM_redirectLoginSuccess#" addtoken="no"&gt;
&lt;cfcatch type="Lock"&gt;
&lt;!--- code for handling timeout of cflock ---&gt;
&lt;/cfcatch&gt;
&lt;/cftry&gt;
&lt;/cfif&gt;
&lt;cflocation url="#MM_redirectLoginFailed#" addtoken="no"&gt;
&lt;cfelse&gt;
&lt;cfset MM_LoginAction=CGI.SCRIPT_NAME&gt;
&lt;cfif CGI.QUERY_STRING NEQ ""&gt;
&lt;cfset MM_LoginAction=MM_LoginAction & "?" & XMLFormat(CGI.QUERY_STRING)&gt;
&lt;/cfif&gt;
&lt;/cfif&gt;
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="&lt;cfoutput&gt;#MM_loginAction#&lt;/cfoutput&gt;" method="POST" name="txtLogin" id="txtLogin"&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td width="24%"&gt;Email&lt;/td&gt;
&lt;td width="76%"&gt;&lt;input name="myEmail" type="text" id="myEmail"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;&lt;input name="myPass" type="text" id="myPass"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&nbsp;&lt;/td&gt;
&lt;td&gt;&lt;input name="Login" type="submit" id="Login" value="Login"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;

Reply to this topic