for one thing, you are setting one cookie, but checking for another...
there are more peculiar things in your code, but let's start with this.

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/



Phillip Perry wrote:
> Hi,
>
> I'm trying to make a simple cookie for testing  but its not working
> out. I use it for log in verification. The problem is the cookie gets
> stored but the redirect is not happening. I use the  code below. The
> second redirect is the problem. Instead of going to newindex.cfm its
> loading the loginform.cfm file. Any ideas what i'm doing wrong?:
>
> <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="index.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">
> <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.">
> <cflocation url="#cgi.script_name#?message=#message#" ADDTOKEN="No">
> </cfif>
>   

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313197
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to