Forums Register Login

getCookie(FacesContext context, String name) function is not woring in tomcat 6.0.

+Pie Number of slices to send: Send
Hi all,

I am using tomcat 6.0 and jsf2. I am trying to access a cookie which was already set.
I am using getCookie() function
[
package com.sun.rave.web.ui.component;
Tree Class - getCookie() method.
].

This function is working fine when i was using tomcat 5.5.20 and now it is not working(tomcat 6.0).

I verifed the cookies strored in firefox(both in Tomcat6 and Tocmat5). They are proper.

In tomcat 6, if we call request.getCookies() - > it is truncationg cookie name after ":" i.e. if our cookie name is 'form1:treeId' then it is returning 'form1' only.

Please help me.
+Pie Number of slices to send: Send
Hi all,

I am using tomcat 6.0 and jsf2. I am trying to access a cookie which was already set.
I am using getCookie() function
[
package com.sun.rave.web.ui.component;
Tree Class - getCookie() method.
].

This function is working fine when i was using tomcat 5.5.20 and now it is not working(tomcat 6.0).

I verifed the cookies strored in firefox(both in Tomcat6 and Tocmat5). They are proper.

In tomcat 6, if we call request.getCookies() - > it is truncationg cookie name after ":" i.e. if our cookie name is 'form1:treeId' then it is returning 'form1' only.

Please help me.
+Pie Number of slices to send: Send
Adding....

I verfied the cookies stored in fire fox. They are proper.

I observed one thing - In tomcat6.0, if i call request.getCookies() function it is returning cookies with cookie name truncated if it finds colon symbol ':' .

i.e. if cookie name is 'form1:treeId' then it is returning 'form1' only.
+Pie Number of slices to send: Send
Hi,

I had similar problem.

I find that its due to an improvement in tomcat 6.0.

":" amongst other characters is a reserved character as per the HTTP Cookie specification, thus it has to be encoded if it must be a part of the cookie data.

http://cephas.net/blog/2008/11/18/tomcat-6018-version-1-cookies-acegi-remember-me-and-ie/

http://marc.info/?l=tomcat-user&m=123991887229053&w=2

If you're in a position to make this adjustment that's the better option.

In my case, the cookie data is set in a client software that is live in over a hundred instances, and i desire to upgrade the single server instance to tomcat 6 (The application has been running on tomcat 5.5 with no issues) without breaking any functionality for existing clients (as per interaction with the server).

So i found a way to parse the header myself using request.getHeader("cookie") to get the raw cookies as String


Regards
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 3055 times.
Similar Threads
Pre select a dropdown using cookie.
submit thru javascript
reg cookies and its syntax..
MultiDimenaional Array sort
need help while using <nested:write>
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:04:20.