Hai
Just use aleart message to show time expiry,Try this,pls add this javascript in MVC4 View MasterPage,then only it work all child page,u can add this in each page also,but master page is common so better to add in master page.Here time wait for 15 mins,u can change ur expiry time
<script type="text/javascript">
var logoutUser = false;
var timeoutHnd = null;
var logouTimeInterval = 15 * 60 * 1000;
function onuser_activite() {
if (logoutUser) {
;
}
else {
ResetLogOutTimer();
}
}
function OnTimeoutReached() {
logoutUser = true;
alert("You have been automatically Log Off from the system !");
window.location.href = "Logout.aspx";
}
function ResetLogOutTimer() {
clearTimeout(timeoutHnd);
timeoutHnd = setTimeout('OnTimeoutReached();', logouTimeInterval);
}
document.body.onclick = onuser_activite;
timeoutHnd = setTimeout('OnTimeoutReached();', logouTimeInterval);
</script>