This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C02292.77958A88
Content-Type: text/plain;
        charset="iso-8859-1"

This is because of the writing to the header both cfcookie and cflocation
write the header. When you set a cookie and then use cflocation the header
is over written by cflocation wiping out the cookie. use JavaScript location
instead.

Shawn Regan

-----Original Message-----
From: Rick Osborne [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 19, 2000 1:47 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [CF-Talk] CFCOOKIE problems


This is a common question.  The problem is actually with the way CF does the
redirect, not with the browser (which is commonly accused of being the
fault), so this will happen with all browsers.  When CF tells the browser to
redirect, it doesn't set a cookie at the same time.  (I'm not sure why, or
if this is even legal.)  You can see what I mean with the following code and
request log:

Code:

  <CFCOOKIE NAME="test" EXPIRES="NEVER" VALUE="thisIsATest">
  <CFLOCATION URL="/index.cfm" ADDTOKEN="No">

Request:

  GET http://partners.womensforum.com/test.cfm HTTP/1.0
  Proxy-Connection: Keep-Alive
  User-Agent: Mozilla/4.08 [en] (Win98; U ;Nav)
  Host: partners.womensforum.com
  Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
          image/png, */*
  Accept-Encoding: gzip
  Accept-Language: en
  Accept-Charset: iso-8859-1,*,utf-8
  Cookie: CFID=162342; CFMAGIC=162342%3A4486494; CFTOKEN=4486494

Response:

  HTTP/1.1 302 Object Moved
  Location: /
  Server: Microsoft-IIS/4.0
  Content-Type: text/html
  Content-Length: 117

  <head><title>Document Moved</title></head>
  <body><h1>Object Moved</h1>This document may be found
  <a HREF="/">here</a>

So, the answer is:

If you are going to set a cookie then you need to do a soft redirect (with a
META tag or javascript, or whatever) instead of the hard redirect with
CFLOCATION.

HTH,
-Rick

-----Original Message-----
From: Gina Shillitani [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 19, 2000 2:31 PM
To: '[EMAIL PROTECTED]'
Subject: [CF-Talk] CFCOOKIE problems


I am attempting to use this:

<CFCOOKIE NAME="profID" VALUE="#profID#" EXPIRES="NEVER">

to set a cookie on a page. It is not setting the cookie. I'm not sure what
I'm doing wrong but it is aggravating me to no end.

Here is the block of code the above tag is in:

<cfelse>
        <cfset profID = 0>
        <cfmodule template="../getProfID.cfm" geckoKey="#geckoKey#"
                profile_id="#checkCode.profile_id#">
        <cfset SaveMe=Form.SaveMe>
        <CFIF SaveMe IS 1>
        <CFCOOKIE NAME="profID" VALUE="#profID#" EXPIRES="NEVER">
        </CFIF>
        <cflocation url="/index.cfm?profID=#profID#&flogin=1">
</cfif>

Gina Shillitani
[EMAIL PROTECTED]
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------_=_NextPart_001_01C02292.77958A88
Content-Type: text/html;
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: [CF-Talk] CFCOOKIE problems</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>This is because of the writing to the header both =
cfcookie and cflocation write the header. When you set a cookie and =
then use cflocation the header is over written by cflocation wiping out =
the cookie. use JavaScript location instead.</FONT></P>

<P><FONT SIZE=3D2>Shawn Regan</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Rick Osborne [<A =
HREF=3D"mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]=
</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, September 19, 2000 1:47 PM</FONT>
<BR><FONT SIZE=3D2>To: [EMAIL PROTECTED]</FONT>
<BR><FONT SIZE=3D2>Cc: [EMAIL PROTECTED]</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [CF-Talk] CFCOOKIE problems</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>This is a common question.&nbsp; The problem is =
actually with the way CF does the</FONT>
<BR><FONT SIZE=3D2>redirect, not with the browser (which is commonly =
accused of being the</FONT>
<BR><FONT SIZE=3D2>fault), so this will happen with all browsers.&nbsp; =
When CF tells the browser to</FONT>
<BR><FONT SIZE=3D2>redirect, it doesn't set a cookie at the same =
time.&nbsp; (I'm not sure why, or</FONT>
<BR><FONT SIZE=3D2>if this is even legal.)&nbsp; You can see what I =
mean with the following code and</FONT>
<BR><FONT SIZE=3D2>request log:</FONT>
</P>

<P><FONT SIZE=3D2>Code:</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; &lt;CFCOOKIE NAME=3D&quot;test&quot; =
EXPIRES=3D&quot;NEVER&quot; VALUE=3D&quot;thisIsATest&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;CFLOCATION URL=3D&quot;/index.cfm&quot; =
ADDTOKEN=3D&quot;No&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>Request:</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; GET <A =
HREF=3D"http://partners.womensforum.com/test.cfm" =
TARGET=3D"_blank">http://partners.womensforum.com/test.cfm</A> =
HTTP/1.0</FONT>
<BR><FONT SIZE=3D2>&nbsp; Proxy-Connection: Keep-Alive</FONT>
<BR><FONT SIZE=3D2>&nbsp; User-Agent: Mozilla/4.08 [en] (Win98; U =
;Nav)</FONT>
<BR><FONT SIZE=3D2>&nbsp; Host: partners.womensforum.com</FONT>
<BR><FONT SIZE=3D2>&nbsp; Accept: image/gif, image/x-xbitmap, =
image/jpeg, image/pjpeg,</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
image/png, */*</FONT>
<BR><FONT SIZE=3D2>&nbsp; Accept-Encoding: gzip</FONT>
<BR><FONT SIZE=3D2>&nbsp; Accept-Language: en</FONT>
<BR><FONT SIZE=3D2>&nbsp; Accept-Charset: iso-8859-1,*,utf-8</FONT>
<BR><FONT SIZE=3D2>&nbsp; Cookie: CFID=3D162342; =
CFMAGIC=3D162342%3A4486494; CFTOKEN=3D4486494</FONT>
</P>

<P><FONT SIZE=3D2>Response:</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; HTTP/1.1 302 Object Moved</FONT>
<BR><FONT SIZE=3D2>&nbsp; Location: /</FONT>
<BR><FONT SIZE=3D2>&nbsp; Server: Microsoft-IIS/4.0</FONT>
<BR><FONT SIZE=3D2>&nbsp; Content-Type: text/html</FONT>
<BR><FONT SIZE=3D2>&nbsp; Content-Length: 117</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp; &lt;head&gt;&lt;title&gt;Document =
Moved&lt;/title&gt;&lt;/head&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;body&gt;&lt;h1&gt;Object =
Moved&lt;/h1&gt;This document may be found</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;a =
HREF=3D&quot;/&quot;&gt;here&lt;/a&gt;</FONT>
</P>

<P><FONT SIZE=3D2>So, the answer is:</FONT>
</P>

<P><FONT SIZE=3D2>If you are going to set a cookie then you need to do =
a soft redirect (with a</FONT>
<BR><FONT SIZE=3D2>META tag or javascript, or whatever) instead of the =
hard redirect with</FONT>
<BR><FONT SIZE=3D2>CFLOCATION.</FONT>
</P>

<P><FONT SIZE=3D2>HTH,</FONT>
<BR><FONT SIZE=3D2>-Rick</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Gina Shillitani [<A =
HREF=3D"mailto:[EMAIL PROTECTED]">mailto:gshillitani@GeckoMedia=
.com</A>]</FONT>
<BR><FONT SIZE=3D2>Sent: Tuesday, September 19, 2000 2:31 PM</FONT>
<BR><FONT SIZE=3D2>To: '[EMAIL PROTECTED]'</FONT>
<BR><FONT SIZE=3D2>Subject: [CF-Talk] CFCOOKIE problems</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>I am attempting to use this:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;CFCOOKIE NAME=3D&quot;profID&quot; =
VALUE=3D&quot;#profID#&quot; EXPIRES=3D&quot;NEVER&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>to set a cookie on a page. It is not setting the =
cookie. I'm not sure what</FONT>
<BR><FONT SIZE=3D2>I'm doing wrong but it is aggravating me to no =
end.</FONT>
</P>

<P><FONT SIZE=3D2>Here is the block of code the above tag is in:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;cfelse&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>&lt;cfset =
profID =3D 0&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>&lt;cfmodule template=3D&quot;../getProfID.cfm&quot; =
geckoKey=3D&quot;#geckoKey#&quot;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>profile_id=3D&quot;#checkCode.profile_id#&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>&lt;cfset =
SaveMe=3DForm.SaveMe&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>&lt;CFIF =
SaveMe IS 1&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>&lt;CFCOOKIE NAME=3D&quot;profID&quot; =
VALUE=3D&quot;#profID#&quot; EXPIRES=3D&quot;NEVER&quot;&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>&lt;/CFIF&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>&lt;cflocation =
url=3D&quot;/index.cfm?profID=3D#profID#&amp;flogin=3D1&quot;&gt;</FONT>=

<BR><FONT SIZE=3D2>&lt;/cfif&gt;</FONT>
</P>

<P><FONT SIZE=3D2>Gina Shillitani</FONT>
<BR><FONT SIZE=3D2>[EMAIL PROTECTED]</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------=
-------------</FONT>
<BR><FONT SIZE=3D2>--</FONT>
<BR><FONT SIZE=3D2>Archives: <A =
HREF=3D"http://www.mail-archive.com/[email protected]/" =
TARGET=3D"_blank">http://www.mail-archive.com/[email protected]/=
</A></FONT>
<BR><FONT SIZE=3D2>To Unsubscribe visit</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dli=
sts/cf_talk" =
TARGET=3D"_blank">http://www.houseoffusion.com/index.cfm?sidebar=3Dlists=
&body=3Dlists/cf_talk</A> or</FONT>
<BR><FONT SIZE=3D2>send a message to [EMAIL PROTECTED] =
with 'unsubscribe' in</FONT>
<BR><FONT SIZE=3D2>the body.</FONT>
</P>

<P><FONT =
SIZE=3D2>---------------------------------------------------------------=
---------------</FONT>
<BR><FONT SIZE=3D2>Archives: <A =
HREF=3D"http://www.mail-archive.com/[email protected]/" =
TARGET=3D"_blank">http://www.mail-archive.com/[email protected]/=
</A></FONT>
<BR><FONT SIZE=3D2>To Unsubscribe visit <A =
HREF=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3Dli=
sts/cf_talk" =
TARGET=3D"_blank">http://www.houseoffusion.com/index.cfm?sidebar=3Dlists=
&body=3Dlists/cf_talk</A> or send a message to =
[EMAIL PROTECTED] with 'unsubscribe' in the =
body.</FONT></P>

</BODY>
</HTML>
------_=_NextPart_001_01C02292.77958A88--
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to