title: How can Tomcat's cookies with quoted values be read correctly in ASP?
body: <p>We have a site which integrates Java web apps under Tomcat with ASP pages, including sharing information in cookies in the traditional ASP key/value format:</p>
  
  <pre><code>Cookie: foo=a=b&amp;c=d; ...
  </code></pre>
  
  <p>As of Tomcat 5.5.26, cookie handling has been altered slightly, with the effect that our cookie value is now enclosed in quotes, which wasn't the case before:</p>
  
  <pre><code>Cookie: foo="a=b&amp;c=d"; ...
  </code></pre>
  
  <p>However, we have ASP code that also reads this cookie, and which expects the values in it to be parseable thus:</p>
  
  <pre><code>Response.Write("["+Request.Cookies("foo")("c")+"]");
  </code></pre>
  
  <p>This now fails to return the expected result:</p>
  
  <pre><code>[d"]
  </code></pre>
  
  <p>I have read about the use of:</p>
  
  <pre><code>javax.servlet.http.Cookie#setVersion(int)
  </code></pre>
  
  <p>to modify this behaviour but it doesn't seem to be what is needed here. I am aware that the quoted value is more "correct", but try telling ASP that... Is there any trick I have missed about getting ASP (or Tomcat) to play nice? TIA as always.</p>