Search code examples
androidcordovavisual-studio-cordova

How to save user credentials in my cordova app


How do i store app's password in my mobile?I want to store my mobile app's password.i want stay logged in even i close the app. if i reopen the app home page must be opened.I must not be asked to login..I am using Apache cordova as my development platform.I have tried that using cordova secure storage plugin..but that is of no use.

Any help is appreciated..


Solution

  • i get the solution i tried local storage its work

    i tried like this to save user credentials

                       `window.localStorage.setItem("key", username);
                        var keyname = window.localStorage.key(0);
                        window.localStorage.setItem("key2", password);
                        var keyname2 = window.localStorage.key(0);`
    

    and to get the saved credentials

            var username = window.localStorage.getItem("key");
            var password = window.localStorage.getItem("key2");