- Home /
How to Save Password in My Login Page ?
I need to save my password for my application for which i don't have to login next time if i entered the Right password like "One Time Login".
is there any method like in iOS there is "NSUserdefaults" ? Please help me out.
I too would like to use a feature like this. Of course one could just store a file or something I guess. But if there is a cleaner way I would love to hear. I'm very new to Unity and C# myself.
Answer by thereturn998 · May 25, 2017 at 02:57 PM
I don't know any direct method to achieve what you want but I can give you a solution. You can create two variables called EnteredPassword and EnteredUsername. You put a checkbox to offer one time login and if it is pressed it saves entered password and EnteredUsername, and at the execution of your application, applications first looks at the username on phone then searches it on database when it finds EnteredUsername in database it checks if EnteredPassword on phone are the same with the password on database and if it is the same it opens the menu without any login.
Answer by tcoursey · May 26, 2017 at 06:05 PM
Use PlayerPrefs to do this. It works great. You can SetString and GetString, they stay persistent even when you close the app ext. You can control if they want to REMEMBER ME or not by clearing the strings etc. Just implemented on a login page myself.
Your answer
Follow this Question
Related Questions
container class save based on Cherno's example 1 Answer
How can I figure if an Object was created at runtime? (for extending Json save/load) 0 Answers
How to create a save & load system with: System.Serializable ??? 1 Answer
Duplicating Scene Level 1 results in _evel 1 when neeeds to be Level 2 1 Answer
Is there a way to activate a timer from another scene? 1 Answer