开发者

iPhone cookies to store username and password

开发者 https://www.devze.com 2023-01-12 13:01 出处:网络
I have no idea how to store username and password details so that the user does not have to login everytime for the iPhone app.

I have no idea how to store username and password details so that the user does not have to login everytime for the iPhone app.

Can anyone l开发者_如何转开发ead me in the right direction? I can't seem to find what to do.

Thanks!


You should be using the Keychain API. It will encrypt the data (not hash, as if you have to send it a the server, then the hash wouldn't be any use).

It's a bit of a pain, so take a look at some of sample code and 3rd-party wrappers available on the internet.


You can use Core Data or SQLite or any other storage (XML, JSON), since there are no cookies in iPhone.

Core Data

http://developer.apple.com/iphone/library/documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html

SQLite

http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/

Also remember to hash the password you should use MD5 at least.

0

精彩评论

暂无评论...
验证码 换一张
取 消