0

We have an application that cares about the order of cookie headers. It shouldn't, since this isn't mandated by the standards and indeed we're getting the headers in various different orders

So we would like to rewrite the headers in Apache so that the cookie headers always appear in a specific order. Is there any way of doing this?

An ideal solution would be specifically about cookie headers, but something that lets us mess with the header order more generally would do too.

  • Not really a server solution, but could you plug a quick python or perl script in between Apache and your app? Seems like breaking a server to fix code is the wrong way to do things, versus writing a tiny bit of code to fix other code. – Jack M. Nov 09 '10 at 16:43
  • Offered mod_headers workaround at Pro Webmasters - would help if you linked between StackExchange sites when cross-posting :) – danlefree Nov 09 '10 at 17:35
  • OK - how do I link? I wasn't aware it was possible! – The Archetypal Paul Nov 09 '10 at 18:09
  • 1
    You might include the permalink as a comment or edit your question to include it (i.e. just add http://webmasters.stackexchange.com/questions/5231/enforcing-a-specific-order-for-cookie-headers toward the end of the question) – danlefree Nov 09 '10 at 19:28

1 Answers1

0

HTTP headers aren't guaranteed to arrive in any particular order, and you shouldn't require them to be. If the cookies are order-sensitive, add an incrementing serial number to the beginning of each one, and reassemble them in your application.

Fahad Sadah
  • 1,496
  • 11
  • 21
  • I know we shouldn't require them, as I say in the question. Unfortunately the client is an embedded system, and the app is weblogic so we don't have that option – The Archetypal Paul Nov 09 '10 at 18:10