Here's what works for what I am doing:
<script type="text/javascript">
// When document is ready...
$(document).ready(function() {
// If scroll AND location cookie is set, and the location is the same
//scroll to the position saved in the scroll cookie.
if ( $.cookie("scroll") !== null && $.cookie("location") !== null
&& $.cookie("location") == $(location).attr('href')) {
$(document).scrollTop( $.cookie("scroll") );
}
// When a button is clicked...
$(':submit').on("click", function() {
// Set a cookie that holds the scroll position.
$.cookie("scroll", $(document).scrollTop() );
// set a cookie that holds the current location.
$.cookie("location", $(location).attr('href'));
});
});
</script>