Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Coldfusion CFCookie problem
Old 09-29-2008, 12:20 AM Coldfusion CFCookie problem
Junior Talker

Posts: 2
Name: Phillip Perry
Trades: 0
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&nbsp;&nbsp;&nbsp;&nbsp;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: &nbsp;<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>
skinman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Coldfusion CFCookie problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13103 seconds with 12 queries