Another way that may work is to set-up the
cflocation tag as a string, and then evaluate it
at the correct moment. I will try this myself a
bit later.

With cflocation itself in the template, CF will
immediately process that line and ignore the rest.


Conrad


-----Original Message-----
From: Mike Sprague [mailto:[EMAIL PROTECTED]]
Sent: 16 April 2001 07:26
To: CF-Talk
Subject: cookies not being set


I have a login page that checks my db to validate user info and if valid
uses cflocation to redirect to the appropriate page.  I need cookies to work
because people with AOL have been having problems keeing the session
variables alive.  My code is below, any help would be greatly appreciated.

Mike


<cfif CheckLogin.RecordCount Is 0 Or CheckLogin.RecordCount GT 1>
  <cfset Session.error_message="Your Login Information Is Incorrect.  Please
Try Again.">
  <cflocation url="/login.cfm" addtoken="No">
<cfelseif CheckLogin.RecordCount Is 1>
  <cfcookie name="UserLevel" value="#int(CheckLogin.UserLevel)#"
expires="1">
  <cfcookie name="LoggedIn" value="true" expires="1">
  <cfcookie name="Username" value="#CheckLogin.Username#" expires="1">
  <cfcookie name="UserID" value="#int(CheckLogin.UserID)#" expires="1">
  <cflocation url="/members/index.cfm" addtoken="Yes">
<cfelse>
  <cflocation url="/login.cfm" addtoken="No">
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to