opensubscriber
   Find in this group all groups
 
Unknown more information…

w : webkitsdk-dev@lists.apple.com 2 January 2006 • 12:21PM -0500

Re: NSURLReqest and cookies
by Rudi Sherry

REPLY TO AUTHOR
 
REPLY TO GROUP




Scott, I'm not sure what you mean in your original message by "the  
cookie gets set and saved".  Can you rephrase that in Cocoa methods?  
That is, are you getting the shared cookie storage (using  
[NSHTTPCookieStorage sharedHTTPCookieStorage] ),and using it to set  
(save) the cookie manually, or do you mean something else?

I'm not very conversant with this area, but I don't see anything in  
the documentation that states that responses containing SetCookie  
will automatically put those cookies into the shared storage for  
future use with requests -- that is, you have to do it manually.

See <http://developer.apple.com/documentation/Cocoa/Reference/
Foundation/ObjC_classic/Classes/NSHTTPCookieStorage_index.html>  for  
some methods that may help.

Rudi

On Dec 26, 2005, at 8:40 AM, Scott Andrew wrote:

> I am using sendSyncronousRequest. It just seems that if no cookie  
> exists that its having difficulty.. If the cookie already exists  
> and was saved by safari all is well..
>
> Scott Andrew
>
> On Dec 23, 2005, at 8:16 PM, Jeff LaMarche wrote:
>
>> Don't know if I can answer your question, but I've found that some  
>> of the URL calls don't use cookies, and some do. I've had good  
>> luck creating an NSMutableURLRequest and then using  
>> NSURLConnection's sendSynchronousRequest:returningResponse:error:  
>> and it seems to respect the cookies.
>>
>> I don't think it's NSURLRequest that's the issue, but how you're  
>> using NSURLConnection. Are you doing this synchronously or  
>> asynchronously?
>>
>> I don't know if I can help much, but I've got a small command-line  
>> program I wrote to screen-scrape from a website that uses cookies  
>> for authentication. It's not a GUI program and doesn't use  
>> callbacks, but it does use cookies correctly, so maybe I can help you
>>
>> Jeff
>>
>>
>>
>> On Dec 23, 2005, at 11:14 AM, Scott Andrew wrote:
>>
>>> I have a question. (I asked this on the webkit list too, i am not  
>>> sure which list is correct).
>>>
>>> I am working on some code using NSURLRequest but i am having  
>>> issues with cookies.
>>>
>>> If i delete the cookie for the website and go in through my code  
>>> and login, all log's in OK and i can see in Ethereal that there  
>>> is a set cookie. The cookie gets set and saved, however, it seems  
>>> the cookie isn't being used because any more queries to the web  
>>> site are telling me i must be logged in (i should be).
>>>
>>> If i go through safari first then a cookie is created (different  
>>> than the one originally created) and all works fine. If after  
>>> logging in through the web site i go to my applicatoin all works  
>>> fine until the cookie is deleted.
>>>
>>> So my question is using NSURLRequest what am I missing?
>>>
>>> Scott Andrew
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Cocoa-dev mailing list      (Cocoa-dev@list...)
>>> Help/Unsubscribe/Update your Subscription:
>>> http://lists.apple.com/mailman/options/cocoa-dev/jeff_lamarche%
>>> 40mac.com
>>>
>>> This email sent to jeff_lamarche@mac....
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webkitsdk-dev mailing list      (Webkitsdk-dev@list...)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webkitsdk-dev/rsherry%
> 40adobe.com
>
> This email sent to rsherry@adob...

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (Webkitsdk-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webkitsdk-dev/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.