views:

1080

answers:

3

Hello Experts!

I am trying to do a POST towards a site which utilizes secure session with cookies. Ofcourse this won't work with the code I have posted below. It keeps responding with a non-authorized message.

Is there any way I can use cookies in my code or at least simulate cookie usage?

    NSURL *url = [[NSURL alloc] initWithString:@"https://long_and_complicated_url"];
 NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url]; 
 NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];

Best regards //Abeansits

+1  A: 

The SDK has cookie support in the form of NSHTTPCookie and NSHTTPCookieStorage

Have you familiarized yourself with these?

nall
Oh, my bad. =(Sorry for wasting your time. I was really tiered when I wrote the question.
ABeanSits
A: 

how can i check mail on my phone with disabled cookies

eluu
A: 

Guys, i really need a hand here, im triying to make a HTTP Post request to a login, retrieve the cookie, store it and then, send another request to the server

the HTTP post request with and without the cookie it's a pice of cake, but im having a lot of trouble sending the POST request and retrieving the cookie.

anyone can give me a clue ???

PD: i don't want to use any third party library.

peter