| Author |
getCookie(FacesContext context, String name) function is not woring in tomcat 6.0.
|
shanmukhan battinapati
Greenhorn
Joined: Feb 24, 2010
Posts: 8
|
|
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.
|
 |
shanmukhan battinapati
Greenhorn
Joined: Feb 24, 2010
Posts: 8
|
|
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.
|
 |
shanmukhan battinapati
Greenhorn
Joined: Feb 24, 2010
Posts: 8
|
|
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.
|
 |
williams ilenikhena
Greenhorn
Joined: Nov 27, 2006
Posts: 7
|
|
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
|
 |
 |
|
|
subject: getCookie(FacesContext context, String name) function is not woring in tomcat 6.0.
|
|
|