udacity / ios-nd-networking

Resources for Udacity's iOS Networking with Swift course.
MIT License
172 stars 88 forks source link

User should stay logged in between sessions. #6

Open OwenLaRosa opened 5 years ago

OwenLaRosa commented 5 years ago

Remember how annoying it is to log in every time you run the app? It would be great if the user could stay logged in.

While you could go the easy route and use UserDefaults to store the session ID, this won't be encrypted (a really bad security problem!)

Instead, you may have some luck using the keychain. It can be a bit overwhelming, but there are wrappers that make using it just like UserDefaults.

This issue may be a bit advanced, especially if you haven't seen persistence on iOS yet, but as you learn more, leveraging some kind of persistence for the user's session would definitely improve the app's usability.