[thelist] cflocation woes

Alex Bello alex at ewanted.com
Mon Jun 11 12:01:57 CDT 2001


If you have a page that sets a cookie and uses the CFLOCATION tag you have
noticed that the cookie never gets set.
The reason it does not get "set" is because the CFLOCATION tag bypasses the
HTTP protocol altogether to do the relocation.
There is a work around. Instead of redirecting a user with the CFLOCATION
tag you can use:

A regular HTTP meta refresh
<META HTTP-EQUIV=Refresh CONTENT="0;
URL=http://NewPage.cfm?OptionalVariable=True">

JavaScript
<script>this.window.location="http://NewURL.com";</script>

ColdFusion
<CFCOOKIE NAME="someName" VALUE="someValue">
<CFHEADER NAME="Refresh" VALUE="0; URL=someURL.cfm">



----- Original Message -----
From: "Aaron Cole" <awcole72 at hotmail.com>
To: <thelist at lists.evolt.org>
Sent: Sunday, June 10, 2001 9:29 PM
Subject: [thelist] cflocation woes


> I'm currently building a password-protected site that utilizes a simple
> cookie to track the user's id.
>
> The index page has a form for the user to enter her username/password.
The
> action page then performs an INSERT and sets a <cfcookie>.
>
> I finish off the action page with a <cflocation> which points back to the
> index page.
>
> For some reason the index page doesn't recognize the cookie.  However, if
I
> comment out the <cflocation> and use a simple href on the action page that
> has to be manually clicked, no problem.
>
> I thought it was a caching problem, but neither refreshing nor adding a
> <META HTTP-EQUIV="Expires" CONTENT="0"> tag does the trick.
>
> I'm at a loss.  Can anyone point me in the right direction?
>
> TIA,
> Aaron
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list