Notes |
|
(0005511)
|
krystian
|
09-18-11 15:13
|
|
You might check this behaviour comparing Resin/Quercus and normal/standard PHP by using this PHP script on server-side:
<?php
$name = 'ARRAY-COOKIE-TEST';
$arrayIdx = 31337;
if(array_key_exists($name, $_COOKIE) && array_key_exists($arrayIdx, $_COOKIE[$name]))
{
echo "behaving like normal PHP";
}
if(array_key_exists($name.'['.$arrayIdx.']', $_COOKIE))
{
echo "behaving like Resin";
}
?>
and sending HTTP request to this script and setting required cookie - as in this example:
private static final String COOKIE_NAME = "ARRAY-COOKIE-TEST";
private static final int ARRAY_INDEX = 31337;
private static final String COOKIE_VALUE = "test-value";
@Test
public void testTracker() throws Exception {
HttpClientParams params = new HttpClientParams();
HttpClient client = new HttpClient(params);
HostConfiguration config = new HostConfiguration();
HttpHost host = new HttpHost("127.0.0.1", 80,
Protocol.getProtocol("http"));
config.setHost(host);
client.setHostConfiguration(config);
HttpMethod method = new GetMethod("/array-cookie-test.php");
method.addRequestHeader("Cookie", COOKIE_NAME + "[" + ARRAY_INDEX
+ "]=" + COOKIE_VALUE + "; expires=Fri, 29-Sep-2012 15:03:21 GMT; path=/");
client.executeMethod(method);
System.out.println(method.getResponseBodyAsString());
} |
|
|
(0005517)
|
krystian
|
09-19-11 14:17
|
|
|
|
(0005519)
|
krystian
|
09-20-11 11:46
|
|
|
|
(0005522)
|
krystian
|
09-21-11 08:37
|
|
Please find attached a patch which fixes the described issue. The patch has been made against the trunk version. I might be missing formatter settings in Eclipse (as the formatter_profile=_caucho in .settings doesn't seem to be available in your SVN's trunk), so I would need to ask you to reformat the code with your formatter settings just after applying the patch.
Cheers,
Krystian |
|