6 Replies Latest reply on Sep 19, 2017 3:33 AM by Tomaz Cerar

    Problem with Wildfly 10.1.0.Final handling multiple cookies with the same name

    Richard Riley Newbie



      I have a situation where my application is required to receive two cookies with different values but with the same name. For example:


      curl -v --cookie "USER_TOKEN=Yes; USER_TOKEN=No" http://my.example.com:8080/myApp/


      However, when testing this against Wildfly 10.1.0.Final I'm only receiving the first cookie i.e "USER_TOKEN=Yes". I realise this probably isn't considered common practice, however there is a section in the spec that covers this:

      "Although cookies are serialized linearly in the Cookie header, servers SHOULD NOT rely upon the serialization order. In particular, if the Cookie header contains two cookies with the same name (e.g., that were set with different Path or Domain attributes), servers SHOULD NOT rely upon the order in which these cookies appear in the header."

      I would be really grateful for any advice on how to proceed with this. Would this be considered a bug? Or is there a work around I could use (other than changing the cookie names..)?


      Thanks in advance for your help,