JavaScript Cookies on webview smartphones!

1

I would like to know if anyone knows how to use or know if they get cookies directly from the smartphone's webview ..

I know they are functions of a browser, but I am making an APP that it needs to temporarily or permanently save, until it is changed, the user login, and the app is entirely in HTML, type JAVA, but HTML5, CSS3 and JAVASCRIPT.

And so the user does not have to stay logged in every time he opens the app would like to save this login data in some way on the device, either way cookies, or creating a file type txt with the information ...

    
asked by anonymous 22.07.2015 / 23:48

1 answer

1

The most reliable solution is localStorage . The localStorage is an object where you can write strings to the keys of that object and it has no timeout.

For example:

localStorage.appUser = 'Pedro';

and later you can use localStorage.appUser to know what value is written.

In javaScript you can not write files. You can always send to the server but if you want to save it to the computer / browser where the user is then localStorage is what I advise you to use.

Example: link

    
22.07.2015 / 23:52