Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Cookie management in http-post
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cookie management in http-post



Hmm. That sounds like it should work, although our http expert is away on vacation this week, and he'd know for sure. What you try an http-request instead of an http-post? If this works, and your post doesn't, that'll be interesting data. I know that we successfully set a cookie in a header as shown below, although our code is going a GET, not a POST.

let $headers := dictionary ( ("Cookie", "sid=ABC1" ) )
let $infoDict := dictionary ( ("Method", "POST"), ("Headers", $headers), ("PostData", $myData) )
let $response := http-request($myURL, $infoDict)


Let me know what you find....

--Jessica

On Thursday, April 17, 2003, at 9:28 AM, Sherlock Developer Trufsoft wrote:

Hi

I have a problem while using http-post in XQuery.
I am using the following code :
let $response := http-post( $myUrl, $myData, $myCookieHeader)

and at the same time I am running tcpflow in a Terminal to see what's
going on. I am surprise to see that the dictionary header
$myCookieHeader does not show up at all in the HTTP Post. I have
initialized the dictionary as follow :

let $myCookieHeader := dictionary( ("Cookie", "sid=ABC1" ) )

but in the tcpflow session I can see a different Cookie header sent to
the server... The cookie header sent is the one I received originally
from a previous http post, but I don't want to send it back... Instead
I want to send my own one !

This is the output of my tcpflow session for the previous HTTP post.
010.000.001.002.53050-010.000.001.009.00080: POST /cgi-bin/TestPost
HTTP/1.0
Content-Length: 124
Cookie: sid=279050; stime=600
Host: coolserver
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)
Connection: close

[some data here]

As you can see Sherlock is not sending the cookie "sid" I defined but
instead a previous one received.

So is there a way for me to either flush the cookie cache or force mine
to be used instead of the one being received previously ? This is
critical otherwise I can end up in a completely different session,
which is not what the user is expecting !

- N
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel- development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Cookie management in http-post (From: Sherlock Developer Trufsoft <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.