I'm having a problem with cookies. The cookie gets set just fine but when i submit the login information, instead of going to the new index page it just reloads a blank login form again. The code is as follows, any help is appreciated. If you want to test it go to
http://www.inter-design.net/support/ username acewildlifesolutions password temp163. I have used almost the exact same code in a different website that works perfectly. I duplicated as much of it as possible to that working release with no luck. Thanks, Phil
APPLICATION.CFM:
<cfapplication SESSIONMANAGEMENT="Yes" NAME="interdesign" CLIENTMANAGEMENT="Yes">
<cfsetting showdebugoutput="YES">
<cfparam name="datasource" default="homerville">
<cfparam name="pw" default="skinn1973">
<cfif NOT IsDefined("SESSION.Auth.Confirmed")>
<cfif NOT IsDefined("COOKIE.CONFIRMED")>
<cfif IsDefined("Form.UserLogin")>
<cfinclude template="LoginCheck.cfm">
</cfif>
<cfinclude template="LoginForm.cfm">
<cfabort>
</cfif></cfif>
CheckLogin.cfm
<cfquery name="GetUser" Datasource="#datasource#" password="#pw#">
SELECT *
FROM admin
WHERE username = '#Form.UserLogin#'
AND password = '#Form.password#'
</cfquery>
<cfif IsDefined("cookie.Confirmed") EQ "Yes">
<cfset session.Admin = StructNew()>
<cfset Session.Admin.Confirmed = "Yes">
<cfheader name="location" value="newindex.cfm">
<cfheader statusCode="302" statusText="Document Moved">
<cfabort>
</cfif>
<cfparam name="form.UserLogin" type="string">
<cfparam name="form.Password" type="string">
<cfif GetUser.RecordCount EQ 1>
<cfset session.Admin = StructNew()>
<cfset Session.Admin.Confirmed = "Yes">
<cfset Session.Admin.ContactID = GetUser.ID>
<cfset Session.Admin.UserName = GetUser.username>
<CFCOOKIE NAME="Check_Login" VALUE="Yes" EXPIRES="NEVER">
<CFCOOKIE NAME="username" value="#Session.Admin.UserName#" EXPIRES="NEVER">
<cfheader name="location" value="newindex.cfm">
<cfheader statusCode="302" statusText="Document Moved">
<cfabort>
<cfelse>
<cfset message="We apologize but that username / password does not match our records. Please try again.">
<cfheader name="location" value="#cgi.script_name#?message=#message#">
<cfheader statusCode="302" statusText="Document Moved">
</cfif>
loginform.cfm:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>InterDesign - Customer Service Log in</title>
<link rel="STYLESHEET" type="text/css" href="../css/support.css">
</head>
<body>
<CFIF IsDefined("Form.UserLogin")>
<CFINCLUDE Template="LoginCheck.cfm">
</CFIF>
<DIV CLASS="center"><img src="../images/masthead.gif" width="768" height="172" alt="" /><br />
<cfif isdefined("url.message")>
<cfoutput>#url.message#</cfoutput></cfif><br />
<div class="menu1"> <a href="index.html" class="centermenu">Home</a> <span class="centermenu">|</span> <a href="services.html" class="centermenu" title="">Services</a> <span class="centermenu">|</span> <a href="Portfolio.html" class="centermenu">Portfolio</a> <span class="centermenu">|</span> <a href="faq.html" class="centermenu">FAQS</a> <span class="centermenu">|</span> <a href="contact.cfm" class="centermenu">Contact</a>
<p class="address">52 Franklin Avenue - Clinton, NY - 13323 315.853.8028</p>
</div>
<div id="container">
<BR>
<BR>
<cfoutput><FORM ACTION="#cgi.script_name#" METHOD="post" NAME="LoginForm">
<TABLE BORDER="0">
<TR>
<TD>
User Name:<INPUT TYPE="text" NAME="UserLogin" STYLE="width:155px" CLASS="searchfield"><BR>
</TD><td></td>
</TR>
<TR>
<TD>Password: <span style="text-align:right;"><INPUT TYPE="Password" NAME="password" STYLE="width:155px;text-align:right;" CLASS="searchfield"></span>
</TD><td><INPUT type="Submit" value="submit"></td>
</TR>
</TABLE></FORM></cfoutput></DIV><BR>
<BR>
<BR>
<BR>
<BR>
</body>
</html>