Is the use of CFLOCATION good/bad practice for "next step" operations?

144 Views Asked by At

I often design step-by-step processes (i.e. Shopping Cart) in the following way:

  1. Form posts to itself
  2. On post, validate entries.
  3. If NOT valid, display the form with error messages.
  4. If valid, save the entries (to SESSION or database, etc.), then send the user to the next step/page using <CFLOCATION />.

My question is, is this the proper use of <CFLOCATION />? Looking at the definition for this tag, it seems that it should be used for actual "moved files", considering it sends an HTTP Header Response Code by default, and allows you to enter another, if needed.

In my case, there's no "moved files", I simply want to send the user to another page after they've completed a task. If someone were to look at the IIS logs, it could be very misleading, seeing a bunch of 301s.

I'm just looking for a best practice principle here, assuming I cannot re-engineer the whole process to use AJAX.

1

There are 1 best solutions below

0
On

Seems fine to me. CFLocation does a 302 redirect by default, so it's fine for temporary redirects. Unless you're specifying 301 for the statusCode?