1

I have an app which requires a username/password at the startup with remember me option.

I am storing these username/password information in apple's keychain. I'm using the apple's default code to store the data and pull out data from keychain.

But after a while, if I go into background and comeback and then use the app and try to make any web service call with my username/password then it somewhere lost the username/password information or clears them.

any idea why keychain looses the password/username information after a while?

Thanks

sigfpe
  • 7,996
  • 2
  • 27
  • 48
Reno Jones
  • 1,979
  • 1
  • 18
  • 30
  • By "apple's default code", do you mean the [GenericKeychain](http://developer.apple.com/library/ios/samplecode/GenericKeychain/Introduction/Intro.html) sample? If so, I have exactly the same problem. – ckhan Apr 20 '12 at 17:49
  • Yeah, generickeychain. I somewhat figured it out by myself. When we set an empty value into keychain then it doesn't actually clear old contents rather it saves this as a new pair in keychain. You might be calling "resetkeychain" in your code somewhere to remove your user/pass entry from keychain but it doesn't actually remove it instead it saves an empty string. – Reno Jones Apr 20 '12 at 23:03

1 Answers1

0

Try the SimpleKeychain class. I had a similar problem, but retrieving/storing credentials works now. https://stackoverflow.com/a/5251820/1271579

Community
  • 1
  • 1
gregorkas
  • 137
  • 5