Changed localstorage to JSON storage via PHP