Saturday, August 21, 2010

asp.net session extension

<script type="text/javascript">
$(document).ready(function () {
setHeartbeat();
});

function setHeartbeat() {

setTimeout("heartbeat()", 300000); // every 5 min
}

function heartbeat() {

$.get(
"/SessionExtender.ashx",
null,
function (data) {
setHeartbeat();
},
"json"
);
}
</script>

No comments: