Set random background image once per session
===

I'm totally new to jquery. I want to be able to set the header background image randomly. I don't want it to change each time the page is refreshed. Rather, I'd just like to set it once per session. I'm assuming I need to use a session cookie for this, but can't get it to work.

The following is what I have thatt works fine on a per-refresh basis. I just want to stop it changing on each refresh.

    $(document).ready(function () {
	var randomImages = ['image1', 'image2', 'image3', 'image4', 'image5'];
	var rndNum = Math.floor(Math.random() * randomImages.length);
	var imageFile = $('#imgpathname').val() + randomImages[rndNum] + ".jpg";
	$("div#header").css({ background: "url(" + imageFile + ") no-repeat" });
    });


Thanks very much for any help.