Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLReqest and cookies



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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/jeff_lamarche% 40mac.com


This email sent to email@hidden


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

This email sent to email@hidden


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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.