By using the following Javascript we can redirect from current page to another address.
<script>
window.onbeforeunload = function () {
location.replace('http://www.google.com');
return "This session is expired and the history altered.";
}
</script>
Note: Placed in header is preferable one.