Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Facing a problem when reading cookies having a colon in the value (Tomcat 6.0.32)

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Tomcat 6.0.32 and im facing a problem when reading cookies having a colon in the value.




Now during the next request when I try reading the cookie value I get the value as "http". When URL encoding it I get the required output.

But reading up the docs say that this should be handled by the container when |org.apache.catalina.STRICT_SERVLET_COMPLIANCE is set to false."|If set to |false|, any v0 cookie with invalid character will be switched to a v1 cookie and the value will be quoted."
I tired setting this but it still fails. Also explicitly setting the version to 1 still gives me the value as just "http".Some articles do mention that the RFC spec indicates that the value can be anything and a colon is legal.

Am I missing something here or is Urlencoding the only way to go about this ?
 
Saloon Keeper
Posts: 26069
186
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably ought to URLEncode anyway. The whole point of the web is that all sorts of clients can use it, and some of them might not handle the cookies properly on their end.
 
if you think brussel sprouts are yummy, you should try any other food. And this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic