Hello,

Following is as detailed a description as i can give as to my problem:

Problem: I am making a sign in form that will allow my customers
access to a private page populated with information specifically
targeted toward them and their account info. Within this form I have a
set of 3 cookies that are being set which remembers the users
username, ID number, and the word "Confirmed" which, of course,
Confirms that the user wants to be remembered. Now this all happens,
at this point, whether the user wants to be remembered, or not (for
testing purposes). This version of the form works just fine. The
cookies all set, and the test information I want displayed after sign
in comes up with no problem. I have it so that the welcome page just
says "Welcome, you are logged in as #cookie.username# ID:
#cookie.ID#."

The issue that comes up is when I try to put a conditional statement
within the cookie part of the template. When I surround the cookies
with <cfif #form.remember# IS "on"></cfif>, that is when all goes down
the drain. The form just refreshes itself. It will not display the
welcome page. I changed the welcome page to say the same as I wrote
above, but I write this as well:

<cfif IsDefined("cookie.confirmed")>
Welcome, you are logged in as #cookie.username# ID: #cookie.ID#
</cfif>
<cfif NOT IsDefined("cookie.confirmed")>
Welcome, you are logged in as #session.Auth.username# ID: #session.Auth.ID#
</cfif>

Unfortunately this does not show up. The form just resets itself and
refreshes the sign in form. I have no idea what I'm doing wrong or
what part of my code is wrong. Can someone see any obvious problems
with this code that I'm overlooking? I've been staring at this code
for a week and my eyes hurt. Any help would be very much appreciated.

The full code is below. Thank you for reading this long email, and I'm
sorry to have taken so much time explaining.

Phil

<cfif IsDefined("cookie.Confirmed") EQ "Yes">
        <cfset session.Admin = StructNew()>
        <cfset Session.Admin.Confirmed = "Yes">
        <cflocation url="index.cfm" addtoken="No">
        <cfabort>
<cfelseif NOT IsDefined("cookie.Confirmed")>



<cfparam name="form.UserLogin" type="string">
<cfparam name="form.Password" type="string">
<cfquery name="GetUser" datasource="#mydbname#">
        SELECT *
        FROM admin
        WHERE username = '#Form.UserLogin#'
        AND password =   '#Form.password#'
</cfquery>

<cfif GetUser.RecordCount EQ 1>
        <cfset session.Admin = StructNew()>
        <cfset Session.Admin.Confirmed = "Yes">
        <cfset Session.Admin.ID = GetUser.ID>
        <cfset Session.Admin.UserName = GetUser.username>
        
        <!---<cfcookie name="Confirmed" value="Yes" expires="NEVER">
         <cfcookie name="username" value="#GetUser.username#" expires="NEVER">
        <cfcookie name="ID" value="#GetUser.ID#" expires="NEVER"> --->
        <cfoutput>
                <script 
language="javascript">location.replace('index.cfm');</script>
        </cfoutput><cfabort>
<cfelse>
        <cfset message = "We apologize but that username / password does not
match our records. Please try again.">
</cfif></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:313366
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