Can't remember if I got back to you to thank you for your great help. So thank you very much oleg, everything works now ;-)
--mike
Oleg Kalnichevski wrote:
On Thu, 2005-02-10 at 16:29 +0100, Michael Niemaz wrote:
Ok it works ... with httpclient-v3.
Do you know if it would work with v2.0.2?
I noticed that httpClient#setParameter method does not exist
for instance ... Was there other ways of doing it at
that time? I hope so ...
One can achieve a similar result when running HttpClient 2.0.2 in so called strict HTTP compliance mode.In the strict mode HttpClient 2.0.x will put all the cookies into one request header. However, the following patch was not back-ported to HttpClient 2.0.x
http://issues.apache.org/bugzilla/show_bug.cgi?id=32833
So, I do recommend upgrading to HttpClient 3.0 unless you can convince the webmaster to fix the broken cookie on the server side
Cheers,
Oleg
--mike
Oleg Kalnichevski wrote:
Michael,
I think I know what is going on. Are you using PHP on the server side,
by any chance?
In the browser compatibility mode force all cookies into one request header. This should do the trick.
See for details: <http://jakarta.apache.org/commons/httpclient/3.0/cookies.html#Browser%20Compatibility>
Hope this helps
Oleg
On Thu, Feb 10, 2005 at 10:04:07AM +0100, Michael Niemaz wrote:
Actually I don't know. The thing is that somehow the server does not accept the cookie I'm reforwarding.
When I compare the log when it's working (=server without dot AND cookie policy set to RFC_2109)
and when it's not (=server with dot and cookie policy set to COMPATIBILITY), there are
the following differences:
non working mode: 2005/02/10 09:36:17:869 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/my/ HTTP/1.1[\r][\n]" 2005/02/10 09:36:17:869 CET [DEBUG] HttpMethodBase - -Adding Host request header 2005/02/10 09:36:17:869 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]" 2005/02/10 09:36:17:869 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]" 2005/02/10 09:36:17:870 CET [DEBUG] header - ->> "Cookie: SF_THEME=000000codex[\r][\n]" 2005/02/10 09:36:17:870 CET [DEBUG] header - ->> "Cookie: SF_FONTSIZE=0000002[\r][\n]" 2005/02/10 09:36:17:870 CET [DEBUG] header - ->> "Cookie: session_hash=e8bef1b1619761b6cd90aeed32f448bb[\r][\n]" 2005/02/10 09:36:17:870 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]" 2005/02/10 09:36:17:870 CET [DEBUG] header - ->> "[\r][\n]" 2005/02/10 09:36:17:969 CET [DEBUG] header - -<< "HTTP/1.0 302 Moved Temporarily[\r][\n]"
working mode: 2005/02/10 09:41:35:116 CET [DEBUG] header - ->> "GET http://cxtst.xrce.xerox.com/my/ HTTP/1.1[\r][\n]" 2005/02/10 09:41:35:117 CET [DEBUG] HttpMethodBase - -Adding Host request header 2005/02/10 09:41:35:117 CET [DEBUG] header - ->> "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)[\r][\n]" 2005/02/10 09:41:35:117 CET [DEBUG] header - ->> "Host: cxtst.xrce.xerox.com[\r][\n]" 2005/02/10 09:41:35:118 CET [DEBUG] header - ->> "Cookie: *$Version=0;* SF_THEME=000000codex; *$Path=/[\r][\n]*" 2005/02/10 09:41:35:118 CET [DEBUG] header - ->> "Cookie: *$Version=0;* SF_FONTSIZE=0000002; *$Path=/[\r][\n]*" 2005/02/10 09:41:35:118 CET [DEBUG] header - ->> "Cookie: *$Version=0;* session_hash=8f0bb58325e4861c4771ac94195e1039; *$Path=/[\r][\n]"* 2005/02/10 09:41:35:118 CET [DEBUG] header - ->> "Proxy-Connection: Keep-Alive[\r][\n]" 2005/02/10 09:41:35:118 CET [DEBUG] header - ->> "[\r][\n]" 2005/02/10 09:41:35:214 CET [DEBUG] header - -<< "HTTP/1.0 200 OK[\r][\n]"
We can see that when it's working, the cookies are different. They have 2 more params: Version & Path.
Is it due to the cookie policy which is different?
The problem we're facing here is that to make the server recognize the forwarded cookie we must use the
RFC_2109 policy but to prevent the client from rejecting the cookie sent by the server, we must use the
COMPATIBILITY policy ...
Should I try to add the 2 more params by hand and stick to the COMPATIBILITY policy?
I'll try that and see how it goes.
What do you think?
--mike
Oleg Kalnichevski wrote:
Michael,
What exactly does not work? As far as I can tell all cookies get accepted and are sent back. The session seems properly maintained. What is exactly the problem?
... << "Set-Cookie: SF_THEME=000000codex; expires=Thu, 09-Feb-2006 17:52:31 GMT; path=/[\r][\n]" << "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:52:31 GMT; path=/[\r][\n] ... Cookie accepted: "SF_THEME=000000codex" Cookie accepted: "SF_FONTSIZE=0000002" ...
"Cookie: SF_THEME=000000codex[\r][\n]"
"Cookie: SF_FONTSIZE=0000002[\r][\n]"
... << "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:52:31 GMT; path=/[\r][\n]" << "Set-Cookie: session_hash=d2061ff094fc1d471121292b24613d83; path=/; domain=.cxtst.xrce.xerox.com[\r][\n]" ... Cookie accepted: "SF_FONTSIZE=0000002" Cookie accepted: "session_hash=d2061ff094fc1d471121292b24613d83" ...
"Cookie: SF_THEME=000000codex[\r][\n]"
"Cookie: SF_FONTSIZE=0000002[\r][\n]"
"Cookie: session_hash=d2061ff094fc1d471121292b24613d83[\r][\n]"
... << "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:52:32 GMT; path=/[\r][\n]" ... Cookie accepted: "SF_FONTSIZE=0000002" ...
"Cookie: SF_THEME=000000codex[\r][\n]"
"Cookie: session_hash=d2061ff094fc1d471121292b24613d83[\r][\n]"
"Cookie: SF_FONTSIZE=0000002[\r][\n]"
<< "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:52:32 GMT; path=/[\r][\n]" ... Cookie accepted: "SF_FONTSIZE=0000002" ...
"Cookie: SF_THEME=000000codex[\r][\n]"
"Cookie: session_hash=d2061ff094fc1d471121292b24613d83[\r][\n]"
"Cookie: SF_FONTSIZE=0000002[\r][\n]"
... << "Set-Cookie: SF_FONTSIZE=0000002; expires=Thu, 09-Feb-2006 17:52:33 GMT; path=/[\r][\n]" ... Cookie accepted: "SF_FONTSIZE=0000002"
On Wed, 2005-02-09 at 19:07 +0100, Michael Niemaz wrote:
wire log with full headers, if you prefer: domainMatch? true
<snip>
.
.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
