Use cookies. There's a plugin for jquery you can get. Here is a bit of code to get you started:
var bgMusic = $('#audio-bg')[0],
playing = true;
bgMusic.addEventListener('ended', function() {
this.currentTime = 0;
if (playing) {
this.play();
}
}, false);
var cookieValue = $.cookie("forcemute");
if(cookieValue == undefined){
bgMusic.play();
}
else{
playing = false;
}
$('#toggle').click(function() {
if (!bgMusic.paused) {
bgMusic.pause();
playing = false;
$(this).css({backgroundPosition: '0 -21px'})
$.cookie("forcemute", 1);
} else {
bgMusic.play();
playing = true;
$(this).css({backgroundPosition: '0 0'})
$.removeCookie("forcemute");
}
});
});