Re: cfcookie tempermental setting: Long Post

2008-10-02 Thread Tom Chiverton
On Thursday 02 Oct 2008, Phillip Perry wrote:
 with cfif #form.remember# IS on/cfif, that is when all goes down

This doesn't appear in your example code.

 Welcome, you are logged in as #session.Auth.username# ID: #session.Auth.ID#

You are not creating these in your example code.

And, as side notes: cfqueryparam all your queries. Be aware that a user can 
create their own cookies.

-- 
Tom Chiverton
Helping to autoschediastically enable back-end interactive wireless 
leading-edge relationships





This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office. Any reference 
to a partner in relation to Halliwells LLP means a member of Halliwells LLP.  
Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.

~|
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:313402
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: cfcookie tempermental setting: Long Post

2008-10-02 Thread Phillip Perry
I apologize for the incomplete code before. Here is the code with the
form.remember stuff in it with some comments added in. The welcome
screen index.cfm is as follows:

cfif IsDefined(cookie.LoggedIn)
Welcome, your logged in as cfoutput#cookie.username# ID:
#cookie.ID#/cfoutput
/cfif
cfif Not IsDefined(cookie.LoggedIn)
Welcome, your logged in as cfoutput#session.Auth.username# ID
#session.Auth.ID#/cfoutput
/cfif

CHECKLOGIN.CFM

!--- set session variables from cookie if they chose remember me
last time ---
cfif IsDefined(cookie.LoggedIn)
cfset session.Auth = StructNew()
cfset Session.Auth.IsLoggedIn = Yes
cfset session.Auth.ID = cookie.id
cfset session.Auth.username = cookie.username
cflocation url=index.cfm addtoken=No
cfabort
/cfif

!--- we're not auto-logging in, so let's authenticate ---
cfparam name=form.UserLogin type=string
cfparam name=form.Password type=string
cfparam name=form.remember default=Off type=string

cfquery name=GetUser datasource=#mydbname#
SELECT *
FROM admin
WHERE username = cfqueryparam value=#Form.UserLogin# /
AND password =   cfqueryparam value=#Form.password# /
/cfquery

cfif GetUser.RecordCount EQ 1
cfset session.Auth = StructNew()
cfset Session.Auth.IsLoggedIn = Yes
cfset Session.Auth.ID = GetUser.ID
cfset Session.Auth.UserName = GetUser.username

cfif form.remember IS On
cfcookie name=LoggedIn value=Yes expires=NEVER
cfcookie name=username value=#GetUser.username# 
expires=NEVER
cfcookie name=ID value=#GetUser.ID# expires=NEVER
/cfif

cfdump var=#session#cfabort
cfoutput
script 
language=javascriptlocation.replace('index.cfm');/script
/cfoutput
cfabort
cfelse





On Thu, Oct 2, 2008 at 11:45 AM, Tom Chiverton
[EMAIL PROTECTED] wrote:
 On Thursday 02 Oct 2008, Phillip Perry wrote:
 with cfif #form.remember# IS on/cfif, that is when all goes down

 This doesn't appear in your example code.

 Welcome, you are logged in as #session.Auth.username# ID: #session.Auth.ID#

 You are not creating these in your example code.

 And, as side notes: cfqueryparam all your queries. Be aware that a user can
 create their own cookies.

 --
 Tom Chiverton
 Helping to autoschediastically enable back-end interactive wireless
 leading-edge relationships



 

 This email is sent for and on behalf of Halliwells LLP.

 Halliwells LLP is a limited liability partnership registered in England and 
 Wales under registered number OC307980 whose registered office address is at 
 Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
 of members is available for inspection at the registered office. Any 
 reference to a partner in relation to Halliwells LLP means a member of 
 Halliwells LLP.  Regulated by The Solicitors Regulation Authority.

 CONFIDENTIALITY

 This email is intended only for the use of the addressee named above and may 
 be confidential or legally privileged.  If you are not the addressee you must 
 not read it and must not use any information contained in nor copy it nor 
 inform any person other than Halliwells LLP or the addressee of its existence 
 or contents.  If you have received this email in error please delete it and 
 notify Halliwells LLP IT Department on 0870 365 2500.

 For more information about Halliwells LLP visit www.halliwells.com.

 

~|
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:313404
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


cfcookie tempermental setting: Long Post

2008-10-01 Thread Phillip Perry
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=javascriptlocation.replace('index.cfm');/script
/cfoutputcfabort
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