• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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: 28068
198
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 want to look young and thin, hang around old, fat people. Or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic