Web Storage lets you save data (variables) in the user's browser session. So you can save local highscores with that object.
Other than that I guess AJAX could communicate with a PHP site which stores to a database or flatfile on the server. Not that I have tried it so far.