JosephConrad
JosephConrad

Reputation: 688

Keep password and session token in keychain

I am wondering how where I can keep both password and session token at once?

According to this tutorial:

http://yuttana.me/2013/08/05/ios-tips-using-keychain-to-store-password-access-token-on-ios-app/

I can keep password this way using key kSecValueData:

[keychainWrapper setObject:@"1a7b0b0bd363c9beef7f9214c3a67c5c" forKey:(__bridge id)(kSecValueData)];

But what key I should use to store session token?

Upvotes: 2

Views: 945

Answers (1)

Mornirch
Mornirch

Reputation: 1144

NSDictionary *dic = @{ @"password": password, @"session": session };
[keychainWrapper setObject:dic forKey:(__bridge id)(kSecValueData)];

you can init a new wrapper with other identifier to store your session, also.

I misunderstand this problem. I think you need store them in kSecValueData together.

Upvotes: 3

Related Questions