Interesting HTTP/Browser issue


The background of this story could get pretty long and complicated if I wanted to explain it all out, so in the interest of getting back to my work term report as quickly as I can I will make this brief. Geoff was having some trouble with his Wiki involving submitting changes. As it turns out, if you have an form on a web page that POSTs to a script that returns a 401 - Authorization Required (ie. it is .htaccess protected) the posted data does not show up where it should. For some reason it ends up in the ==REQUEST_METHOD== environment setting. So if you had a field named ‘age’ and the value was submitted 22, then the ==$_SERVER[‘REQUEST_METHOD’]== would contain:

age=22POST

However, I can only get this problem to occur in IE for Windows - which I guess isn’t surprising. The problem is due to the browser caching the POST request when it is prompting for authentication information. Opera, Safari and more stable versions of Firefox are fine. Geoff mentioned that the most recent Firefox (on windows) was giving him the same issues though. Apparently the issue can be resolved in IE when you also use the id attribute of the form tags.

Written by Colin Bate