You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Schroer <pe...@blueits.com> on 2015/04/14 14:53:09 UTC

Rfc6265 cookies starting with a dot

Hello,

I'm using tomcat 8.0.21 with the new Rfc6265 cookie processor. If there are
cookies starting with a dot I'm getting the following error:

java.lang.IllegalArgumentException: An invalid domain [.db-app.de] was
specified for this cookie

org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6265Coo
kieProcessor.java:180)

org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265Coo
kieProcessor.java:122)

org.apache.catalina.connector.Response.generateCookieString(Response.java:95
9)

org.apache.catalina.connector.Response.addCookie(Response.java:907)

org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:3
92)

org.esigate.servlet.impl.ResponseSender.sendResponse(ResponseSender.java:70)

com.bahn.esiExtensions.ExtendedProxyServlet.doFilter(ExtendedProxyServlet.ja
va:104)


Is there a way to stop tomcat from throwing this error? Using the old cookie
processor is not an option because the old processor isn't able to handle
cookies containing umlauts.

Thanks in advance
Peter 

 


Re: AW: Rfc6265 cookies starting with a dot

Posted by Mark Thomas <ma...@apache.org>.
On 14/04/2015 09:05, Peter Schroer wrote:
> This isn't possible because I'm writing some kind of proxy and I dont't have
> any influence on the websites (and the cookies of course). It would be
> possible to ignore invalid cookies if tomcat could be configured to do so.

The error message is from the application setting the cookie. If
ignoring invalid cookies is an option, could you catch the IAE, ignore
it (or log it) and carry on?

Mark


> 
> Greetings Peter
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Mark Thomas [mailto:markt@apache.org] 
> Gesendet: Dienstag, 14. April 2015 16:02
> An: Tomcat Users List
> Betreff: Re: Rfc6265 cookies starting with a dot
> 
> On 14/04/2015 07:53, Peter Schroer wrote:
>> Hello,
>>
>> I'm using tomcat 8.0.21 with the new Rfc6265 cookie processor. If 
>> there are cookies starting with a dot I'm getting the following error:
>>
>> java.lang.IllegalArgumentException: An invalid domain [.db-app.de] was 
>> specified for this cookie
>>
>> org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6
>> 265Coo
>> kieProcessor.java:180)
>>
>> org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6
>> 265Coo
>> kieProcessor.java:122)
>>
>> org.apache.catalina.connector.Response.generateCookieString(Response.j
>> ava:95
>> 9)
>>
>> org.apache.catalina.connector.Response.addCookie(Response.java:907)
>>
>> org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.
>> java:3
>> 92)
>>
>> org.esigate.servlet.impl.ResponseSender.sendResponse(ResponseSender.ja
>> va:70)
>>
>> com.bahn.esiExtensions.ExtendedProxyServlet.doFilter(ExtendedProxyServ
>> let.ja
>> va:104)
>>
>>
>> Is there a way to stop tomcat from throwing this error?
> 
> Don't use an invalid value for the domain when creating the cookie.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Rfc6265 cookies starting with a dot

Posted by Peter Schroer <pe...@blueits.com>.
This isn't possible because I'm writing some kind of proxy and I dont't have
any influence on the websites (and the cookies of course). It would be
possible to ignore invalid cookies if tomcat could be configured to do so.

Greetings Peter


-----Ursprüngliche Nachricht-----
Von: Mark Thomas [mailto:markt@apache.org] 
Gesendet: Dienstag, 14. April 2015 16:02
An: Tomcat Users List
Betreff: Re: Rfc6265 cookies starting with a dot

On 14/04/2015 07:53, Peter Schroer wrote:
> Hello,
> 
> I'm using tomcat 8.0.21 with the new Rfc6265 cookie processor. If 
> there are cookies starting with a dot I'm getting the following error:
> 
> java.lang.IllegalArgumentException: An invalid domain [.db-app.de] was 
> specified for this cookie
> 
> org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6
> 265Coo
> kieProcessor.java:180)
> 
> org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6
> 265Coo
> kieProcessor.java:122)
> 
> org.apache.catalina.connector.Response.generateCookieString(Response.j
> ava:95
> 9)
> 
> org.apache.catalina.connector.Response.addCookie(Response.java:907)
> 
> org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.
> java:3
> 92)
> 
> org.esigate.servlet.impl.ResponseSender.sendResponse(ResponseSender.ja
> va:70)
> 
> com.bahn.esiExtensions.ExtendedProxyServlet.doFilter(ExtendedProxyServ
> let.ja
> va:104)
> 
> 
> Is there a way to stop tomcat from throwing this error?

Don't use an invalid value for the domain when creating the cookie.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Rfc6265 cookies starting with a dot

Posted by Mark Thomas <ma...@apache.org>.
On 14/04/2015 07:53, Peter Schroer wrote:
> Hello,
> 
> I'm using tomcat 8.0.21 with the new Rfc6265 cookie processor. If there are
> cookies starting with a dot I'm getting the following error:
> 
> java.lang.IllegalArgumentException: An invalid domain [.db-app.de] was
> specified for this cookie
> 
> org.apache.tomcat.util.http.Rfc6265CookieProcessor.validateDomain(Rfc6265Coo
> kieProcessor.java:180)
> 
> org.apache.tomcat.util.http.Rfc6265CookieProcessor.generateHeader(Rfc6265Coo
> kieProcessor.java:122)
> 
> org.apache.catalina.connector.Response.generateCookieString(Response.java:95
> 9)
> 
> org.apache.catalina.connector.Response.addCookie(Response.java:907)
> 
> org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:3
> 92)
> 
> org.esigate.servlet.impl.ResponseSender.sendResponse(ResponseSender.java:70)
> 
> com.bahn.esiExtensions.ExtendedProxyServlet.doFilter(ExtendedProxyServlet.ja
> va:104)
> 
> 
> Is there a way to stop tomcat from throwing this error?

Don't use an invalid value for the domain when creating the cookie.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org