How to terminate ASIHTTP connection in iphone?

I have an authentication problem ASIHTTPRequest. The steps are performed in the following order:

  • The user enters the wrong username and password → There is no data coming from the backend, and the request of the failed delegate is called from ASIHTTPRequest. Then go to the login page.

  • The user enters the correct values ​​→ The data arrives as expected, and the requested finished method gets called. Then go to the login page.

  • The user enters the wrong username and password → the data arrives again and the called method is requested.

The code I'm using is:

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request setTimeOutSeconds:60];

[request setUsername:User_Name];
[request setPassword:Pass_Word];
[request setValidatesSecureCertificate:NO];
[request setShouldPresentCredentialsBeforeChallenge:NO];
[request startAsynchronous];

The backend processes stateless web services. What is the problem? and what am i doing wrong? please help me.

Thanks, Vinod.

+3
2

, :

[request setUseSessionPersistence:NO];
+1

shouldPresentCredentialsBeforeChallange:YES ( ).

+1

All Articles