An option, similar in its idea, to Solution 1 (Richard Deeming) is to use (learn) php. PHP is a server side language. It can do two things that are useful to your problem.
It can edit files (that are also on the server side - not on the client)
It can store data and share it between pages (in what are called SESSION variables).
If you are using javaScript, php is not that much different. The abilities it will add to your web-programming are incalculable in how they'll improve things.
You can learn it, from the ground up and without any pain,
here.[
^]
Besides the ability to customize pages you send to users, you'll be able to access databases like MySQL, SQL, etc.