NSHTTPCookieStorage deleteCookie does'nt work in ios6?

380 views Asked by At

my problem that the below code:

 [[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:cookie];

works fine with ios 5 but with ios6 cookies are not deleted and the web view still uses the same cookies setted before.

Does anyone has an idea about this issue?

Update

after killing the app , it works fine.

1

There are 1 answers

0
Mejdi Lassidi On BEST ANSWER

The problem was with this method which i used to make authentication:

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge{


       [[challenge sender] useCredential:[NSURLCredential credentialWithUser:Username password:Password persistence:CredentialsPresistance]


forAuthenticationChallenge:challenge];
}

the "persistence" ought to be equal to NSURLCredentialPersistenceNone in ios6 only.

This solved my problem.