Hi,
am not a experianced coder, would like to seek for help.
i would like to create a session logout.
a pop out appear which able to count 60 sec " Warning your eMyHome session will expire in 60 seconds. Do you wish to continue?"
with button continue & logout.
i would like below to be coded in my script.
- if click on continue it should appear after the 60 sec if session idle
- if click on logout go back to main page
- if nothing/no response then sys automatically show the main page after the session expired.
below is the code i use currently.
can anyone modify for me according to my above conditions.
Pls help?
<script language="javascript" type="text/javascript">
function timeControl() {
setTimeout('userCheck()', 60000);
}
function userCheck() {
var id = setTimeout('pageReload()', 60000);
var answer = confirm(" Warning your eMyHome session will expire in 60 seconds. Do you wish to continue?")
if (answer) {
clearTimeout(id);
timeControl();
}
else {
window.location.href = "eMyHomeMain.aspx";
}
}
function pageReload() {
window.location.reload(true);
}
timeControl();
</script>