[plt-scheme] Problem with Post-Redirect-Get in FireFox

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Wed Aug 8 16:26:31 EDT 2007

Hi all,

I am making the code for my web programming tutorial ready
for release, but have run into a problem that puzzles me.

You see the servlet work in Internet Explorer, Opera, and
Safari (all on Windows). Alas, it doesn't work with FireFox.

The scenario is as follows:

   - a form is submitted to the servlet via a POST
   - the request is received by the server,
   - to avoid the data being posted twice in case the user hits refresh,
     a redirect is generated (I have tried both 303 "See Other" (HTTP 1.1
     only) and 302 "Moved Temporarily"

In FireFox everything is okay, the first time the form is posted,
but the second time it is as if a loop occurs (since I see several
requests in the log). FireFox notices this and gives me the error
(translated from Danish):

   This page doesn't redirect properly

   FireFox has discovered that the server redirects the request
   for this address in a way that causes FireFox never to finish.

     * this problem is some times caused by disabled cookies, or
       denial of receival of cookies

Am I missing something obvious? Any ideas are appreciated.

Note: I am building my own response with make-response/full.
       The builtin redirect-to uses 302.

Jens Axel Søgaard

Posted on the users mailing list.