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



Hello again

I have finally a workaround to this problem... Thank to Jussi-Pekka to indicate that cookies sent to non FQDN domains are ignored. My workaround was to switch the full hostname for the server to its IP address and it's working now... The cookies are not sent to it !
I hope now everything will work as expected !


Thank for the tip !

-N

On Friday, April 18, 2003, at 06:17 AM, Sherlock Developer Trufsoft wrote:

Hi

the domain used for the HTTP post is a full qualified domain. And the first time I execute an HTTP post to it, all the following POST will send back the initial cookies even if I try to clear them... I am surprise that either Sherlock or WebFoundation decide to override the values set by the developer, that should be considered as a bug.

If I set specifically the cookie's values to an empty values then they should be used no matter what was the values stored in > WebFoundation...

-N

On Thursday, April 17, 2003, at 09:32 PM, Jussi-Pekka Mantere wrote:

N,

Cookies received by Sherlock document() and http-...() calls are stored under ~/Library/Application Support/WebFoundation/HTTPCookies.plist .

There's a bug in Sherlock / WebFoundation where cookies sent to non-FQDN targets (such as "localhost", "myhostname", ...) are >> ignored.

sherlock://homepage.mac.com/uucee/bugs/Sherlock3/WebFoundation- Cookies/cookies.xml

Jussi-Pekka

On Thursday, April 17, 2003, at 08:31 PM, Sherlock Developer Trufsoft wrote:

Jessica

still no luck by doing your solution... I can still see the previous cookie being send to the server !
Is there a way to empty the cache where all the cookies are saved ? From Sherlock of course either using XQuery or JavaScript ?


I can't change the server side to have the cookies expire faster since I do not own it. Right now the cookies returned are expiring in 5 years... as you can guess it does not help and I am stuck with those cookies.

I even try to add ("DisableCache", true()) as an extra parameter but without success.

-N

On Thursday, April 17, 2003, at 03:51 PM, Jessica Kahn wrote:

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.
_______________________________________________
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: 
 >Re: 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.