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.

  1. if click on continue it should appear after the 60 sec if session idle
  2. if click on logout go back to main page
  3. 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>

need a help, can someone assist me.
thank you!

Hope someone can assist me!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.