Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » log cookies
log cookies [message #869434] Thu, 03 May 2012 11:53 Go to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
When I looked in my log file I have seen the below lines:

[2012-05-03 09:24:16.029] Cookies: Invalid cookie. Value not a token or quoted value

this displays continuously, however my UI works good but this line is getting continuously logged in the log file, what is wrong here?

Environment is:Server - virgo-tomcat-server-3.0.2
Re: log cookies [message #869575 is a reply to message #869434] Thu, 03 May 2012 16:07 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Hi

That means that the cookie header value is not correct.

The value should have the following syntax as per RFC 2965:
[WS][$]token[WS]=[WS](token|QV)[;|,]
WS - white space
QV - quoted value

You can see the Cookies that were sent, just set the log level to DEBUG for log org.apache.tomcat.util.http.Cookies

Regards
Violeta
Re: log cookies [message #869728 is a reply to message #869575] Fri, 04 May 2012 04:50 Go to previous messageGo to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
Hi Violeta,

Thank you very much for your reply.

My cookies are set correctly in the browser, I have seen the cookie values which I have set through the code in the fire-fox browser by clicking the options - show cookies.

Also functionality & UI is working good as expected.

Also when we developed this application using jetty server in development environment, it works good, there are no such log messages are written &
when we tested the same application in test environment in virgo tomcat server 3.0.2, it works great as expected, there are no such log entry in the log file.

We have shifted our application to live environment (virgo tomcat server 3.0.2) where we have faced this (Cookies: Invalid cookie. Value not a token or quoted value) log entry issue, however in live also application is working good.

FYI - I have set the cookies by following code:

private Cookies cookies; // This is tapestry cookie

cookies.writeCookieValue("isUserLogin", "True", -1);

Thank you again for your help...

[Updated on: Fri, 04 May 2012 04:51]

Report message to a moderator

Re: log cookies [message #869915 is a reply to message #869728] Fri, 04 May 2012 19:31 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Hi,

I'm still curious what is the value of the cookie, so if you can switch the log level for the logger that I mentioned above and if you can share with us the cookie value I might try to check what causes the log message that you have faced.

Regards
Violeta
Re: log cookies [message #871520 is a reply to message #869915] Mon, 14 May 2012 10:11 Go to previous messageGo to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
Hi Violeta,

Thank you for your reply.

This is what I have got in my request headers (Taken using firebug)

Cookie BigIP_Colcms=271399780.0.0000


[Updated on: Mon, 14 May 2012 10:16]

Report message to a moderator

Re: log cookies [message #871575 is a reply to message #869915] Mon, 14 May 2012 13:00 Go to previous messageGo to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
Hi Violeta,

Also can you tell me where to change the log level of org.apache.tomcat.util.http.Cookies to turn off this unwanted log messages in virgo-tomcat-server 3.0.2?

[Updated on: Mon, 14 May 2012 13:00]

Report message to a moderator

Re: log cookies [message #872509 is a reply to message #871575] Wed, 16 May 2012 08:51 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Quote:
Cookie BigIP_Colcms=271399780.0.0000


I do not think that this cookie is the problematic one.

I do not recommend to hide the log untill you know what the problem is.

As I wrote several times, you can enable org.apache.tomcat.util.http.Cookies in Debug mode so that you can check what comes to Virgo Tomcat Server as cookies, it migth be some additional symbols that cannot be seen with firebug.

When you know what the exact problem is, you can play with the following system properties (http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Specification):

org.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE - If this is true Tomcat will allow '=' characters when parsing unquoted cookie values. If false, cookie values containing '=' will be terminated when the '=' is encountered and the remainder of the cookie value will be dropped. If not specified, the default value specification compliant value of false will be used.

org.apache.tomcat.util.http.ServerCookie.ALLOW_HTTP_SEPARATORS_IN_V0 - If this is true Tomcat will allow HTTP separators in cookie names and values. If not specified, the default specification compliant value of false will be used.

org.apache.tomcat.util.http.ServerCookie.ALWAYS_ADD_EXPIRES - If this is true Tomcat will always add an expires parameter to a SetCookie header even for cookies with version greater than zero. This is to work around a known IE6 and IE7 bug that causes IE to ignore the Max-Age parameter in a SetCookie header. If org.apache.catalina.STRICT_SERVLET_COMPLIANCE is set to true, the default of this setting will be false, else the default value will be true.

org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR - If this is true then the / (forward slash) character will be treated as a separator. Note that this character is frequently used in cookie path attributes and some browsers will fail to process a cookie if the path attribute is quoted as is required by a strict adherence to the specifications. This is highly likely to break session tracking using cookies. If org.apache.catalina.STRICT_SERVLET_COMPLIANCE is set to true, the default of this setting will be true, else the default value will be false.

org.apache.tomcat.util.http. ServerCookie.STRICT_NAMING - If this is true then the requirements of the Servlet specification that Cookie names must adhere to RFC2109 (no use of separators) will be enforced. If org.apache.catalina.STRICT_SERVLET_COMPLIANCE is set to true, the default of this setting will be true, else the default value will be false.

org.apache.tomcat.util.http. ServerCookie.ALLOW_NAME_ONLY - If this is true then the requirements of the cookie specifications that cookies must have values will be enforced and cookies consisting only of a name but no value will be ignored. If not specified, the default specification compliant value of false will be used.


Re: log cookies [message #872559 is a reply to message #872509] Wed, 16 May 2012 10:42 Go to previous messageGo to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
>you can enable org.apache.tomcat.util.http.Cookies in Debug mode so that you can check what comes to Virgo Tomcat Server as cookies

Sorry for this basic question, Can you tell me how to do that?

Is that need to be done in application level or virgo tomcat server config level?
Re: log cookies [message #872606 is a reply to message #872559] Wed, 16 May 2012 12:45 Go to previous messageGo to next message
Violeta Georgieva is currently offline Violeta Georgieva
Messages: 238
Registered: October 2010
Senior Member
Th easiest way is to change the root level for a while

<Virgo-Home>/config/serviceability.xml

<root level="DEBUG">
<appender-ref ref="SIFTED_LOG_FILE" />
<appender-ref ref="LOG_FILE" />
</root>
Re: log cookies [message #872953 is a reply to message #872606] Thu, 17 May 2012 07:12 Go to previous messageGo to next message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
Hi Violeta,

Thank you for your continuous help and patience with me...

The following are the cookie values:

isUserLogin=True; userId=2058; smsAvail=30; position=2; Ids=10025033/10025032

but even after in development mode I changed the root level to

<root level="DEBUG">
<appender-ref ref="SIFTED_LOG_FILE" />
<appender-ref ref="LOG_FILE" />
</root>

I didn't see the below error msg in my log file in any of the places,

"Cookies: Invalid cookie. Value not a token or quoted value"

But it still throws the above msg in live server. That above log is being written in live server all the time please help me to stop this.

To re-create this in development mode, also to stop this in live server what should be done?

FYI - In UI and in functionality everything works fine - In one particular module I fully used this cookies for user based information that module also working good in development, test & even in live environment also (it indicates that cookies is working correctly in all environment then why that above msg is being written in live environment alone?)...

[Updated on: Thu, 17 May 2012 07:15]

Report message to a moderator

Re: log cookies [message #875077 is a reply to message #872953] Tue, 22 May 2012 05:30 Go to previous message
karthik elavan is currently offline karthik elavan
Messages: 70
Registered: August 2011
Location: Chennai
Member
Anyone help me?
Previous Topic:Logback DBAppender in Virgo.
Next Topic:Use of plain old Eclipse Plugins with Virgo Tooling
Goto Forum:
  


Current Time: Sun Sep 21 22:29:44 GMT 2014

Powered by FUDForum. Page generated in 0.05661 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software