in Education by
I am connecting to server using NSURLConnection. The server asks for basic authentication for which I am using the delegate methods :-didReceiveAuthenticationChallenge. But this gets called only once. If I change password to some different value, then this delegate methods does not get called and it takes my login as successful? Any kind of help will be appreciated. Thanks. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Solved! It turns out that NSURLConnection was actually behaving correctly - that is, didReceiveAuthenticationChallenge: was being called for every authentication challenge. The problem was that the server was not sending challenges after the first one. This turned out to be because the server was setting a cookie. You can force a new challenge by simply deleting the cookie. Because there are no other useful cookies for this server, I just delete all of them: - (void)clearCookiesForURL { NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; NSArray *cookies = [cookieStorage cookiesForURL:_URL]; for (NSHTTPCookie *cookie in cookies) { NSLog(@"Deleting cookie for domain: %@", [cookie domain]); [cookieStorage deleteCookie:cookie]; } }

Related questions

0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I would like to send one request when I scroll the tableview up and another request when I scroll down ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Sometimes, when dynamic body moving and collide static body, dynamic stuck, and stopping. http://imageshack. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    i want to remove currencyViews (tableViews) that are not more needed. i can change dynamically them, and if ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 25, 2022 in Education by JackTerrance
0 votes
    There are record-once versions of the compact disk and digital video disk, which can be written only once ... Media in portion Storage and File Structures of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    I have created an app which I used the JSQMessageViewController and it works fine in iOS 8. I used ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have minified all my js files using require, but require created a minified js file( main.min.js ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 18, 2022 in Education by JackTerrance
0 votes
    I have minified all my js files using require, but require created a minified js file( main.min.js ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 16, 2022 in Education by JackTerrance
0 votes
    I have an object that I want to move by swipe, for example when the swipe is up the object ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    I am trying to open a zip file and iterate through the PDFs in the zip file. I want to scrape a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
0 votes
    With reference to satellite communication, the anti-jamming technique preferred is select one: a. Key leverage ... spectrum modulation Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    The handler runs only once even if you run the Playbook many times. (1)True (2)False...
asked Jul 5, 2021 in Education by JackTerrance
0 votes
    In NoSQL databases, the data can be stored ___________. (1)Multiple times (2)Only once...
asked Apr 21, 2021 in Technology by JackTerrance
...