You cannot use CFCOOKIE and CFLOCATION on the same page.
You'll have to code your redirects using Javascript and the onLoad Event.
Jeff Garza
Web Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-----Original Message-----
From: Mike Sprague [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 10:26 AM
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