Reputation: 303
Only in some cases, i've this error calling and XPage
java.lang.illegalArgumentException: Cookie name "some name" is a reserved token
What could be the cause? How to resolve this?
UPDATE
this is the full error row inside error-log-0.xml
<values>java.lang.IllegalArgumentException: Cookie name "Urbanistica e
Verde&count" is a reserved token
	at java.lang.Throwable.<init>
(Throwable.java:67)
	at javax.servlet.http.Cookie.<init>
(Cookie.java:128)
	at com.ibm.domino.xsp.bridge.http.servlet.XspCmdHttpServletRequest.parseCookieString (XspCmdHttpServletRequest.java:338)
	at com.ibm.domino.xsp.bridge.http.servlet.XspCmdHttpServletRequest.getCookies(XspCmdHttpServletRequest.java:269)
	at com.ibm.domino.xsp.bridge.http.servlet.XspCmdHttpServletRequest.readSessionId(XspCmdHttpServletRequest.java:171)
	at com.ibm.domino.xsp.bridge.http.servlet.XspCmdHttpServletRequest.<init>(XspCmdHttpServletRequest.java:142)
	at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:256)
</values>
UPDATE 2
XSP has this SSJS in afterPageLoad
event
var cgi = new CGIVariables();
var exCon = facesContext.getExternalContext();
var response = exCon.getResponse();
response.setHeader("cache-control", "no-cache");
response.setDateHeader("Expires", -1);
com.xxx.MyClass.myMethod(
facesContext.getExternalContext().getRequest(),
response
);
facesContext.responseComplete();
CGIVariables
is a Server Javascript function (see here), but actually is not used.
In myMethod
inside MyClass
i don't set cookies. Could be the problem in CGIVariables
function?
UPDATE 3 I've made some screenshot about traffic network (with IE development tool), with the requests made. Here the requests:
Here the details about a request:
Here the details about cookies sent (as you can see, there are no cookies with the reserved name, the string Urbanistica e Verde
is in the value of one of the cookies -> see the red line)
UPDATE 4
Problem seems related to the cookie value
, not to the cookie name
. Deleting ',' character in cookie value solve the problem
Upvotes: 0
Views: 438
Reputation: 714
Basically, you are using an illegal name.
From this website,
The name must conform to RFC 2965. That means it can contain only ASCII alphanumeric characters and
cannot contain commas, semicolons, or **white space** or begin with a $ character.
There are also other characters that cannot be used.
Upvotes: 1