localStorage – How to store the data of multiple users? [pendente]

I am working on a front project and I need to register multiple users and their correct addresses on the local storage to display them on my main page. How can I do this using only HTML, CSS and JavaScript?

xss – What is the security risk of storing an authentication token in localStorage versus cookies?

A cookie marked httpOnly, as its name indicates, is not accessible from javascript. Thus, a "conventional" web application using cookies is not vulnerable to naive XSS attacks if this flag is set (assuming no browser bug exposes it naturally). In particular, such a solution is vulnerable to CSRF; an extra effort is needed to remedy this.

In SPA frameworks, you usually need to have access to the javascript cookie because they want to put it in an authorization header and not just rely on old school-based cookie-based security. This has the advantage of being now resistant to the CSRF.

The basic reason for a SPA is that if someone manages to inject javascript, he won. You must not have XSS vulnerabilities because the attacker can change everything about your application and simply make any malicious action with the stolen token in the victim's browser. (or simply modify your application to steal the password in plain text of the user …)

As a result, people choose to tolerate the potential exposure of the session token because the supposed consequence of a successful XSS on a SPA is anyway a 100% compromise.

(In my opinion this is not at all a regulated subject, people still have heated arguments about it. There is an incalculable number of blog posts and flame wars on the forums that fight on both sides

angle – Ionic 3 LocalStorage disappears

I have an application in Ionic 1 that records information about local storage.
I have rewritten the same application on Ionic 3 with the same package ID (widget ID in config.xml), but when installing the new application on the old, I lose the localStorage, this one is empty.

If I install the old version again over the new one, I can see localStorage again, it's as if they were different applications, but they have the same package ID and j & # 39; 39, always installs on each other.

This only happens on mobile, applications do not share the same local storage. When accessing Google Devtools in the "Application" tab – "Storage" – "Local Storage", "file: //" appears when I drag the application created in Ionic 1 and "http: // localhost: 8080". created in Ionic 3.

Is there any particularity in Ionic 3 that can not see / access Ionic 1's local storage and vice versa?

javascript – Store "scroll" in LocalStorage

When the user clicks a particular button, the scroll position of an item changes. I would like this action to be stored in LocalStorage, but I do not know how to do it … can you help me?

Here is my script:

$ (& # 39; .btn.parteum & # 39;). click (function () {
$ (# Textarea #); animate ({scrollLeft: 0}, 400);
returns false;
$ (& # 39; .btn.parte2 & # 39;). click (function () {
$ (# Textarea #); animate ({scrollLeft: 140}, 400);
returns false;

jquery – Change the style / theme of the site and store it in LocalStorage

I have a theme change system on my blog, however, it has some problems, like, it can not change the style of a div.class added by jquery (addclass) or pseudo-elements (after / before / active, etc.) all disorganized !!

I am looking for a new way to proceed (OR A SOLUTION, if it exists) and I will love it if you give me suggestions …

Simplified example of my current system in JSFiddle: https://jsfiddle.net/ybocfr7n/1/

I'm showing how it works, by changing the style of the item, by recording it in local storage and indifference when trying to change the theme of the item. 39, an element: after.

Thank you so much 😉

Check if specific content exists in the localStorage

I need to check inside the beautiful ID's there is a specific number, so that I can update or add

(2) ["{"id":"1","src":"data:image/octet-stream;base64,/9…REBERAREQEREBERAREQEREBERAREQEREBERAREQEREH/9k="}", "{"id":"2","src":"data:image/octet-stream;base64,/9…AiIgIiICIiAiIgIiICIiAiIgIiICIiAiIgIiICIiAiIg//Z"}"]
0: "{" id ":" 1 "," src ":" data: image / octet-stream; base64, / 9 "
1: "{" id ":" 2 "," src ":" data: image / octet-stream; base64, / 9 "
length: 2
__proto__: Table (0)