stop a javascript countdown

Discussion in 'JavaScript' started by asddsa1, Apr 6, 2009.

  1. #1
    very simple question

    I want to interact with a java webpage changing the value of variable x in order to stop the countdown!

    I tried to reset the value of x to 10 with


    javascript:alert(x=10)

    and it works, it lets me log out in 10 seconds instead of 1 hour..

    now I would like to do the opposite, setting the value of x to 500000 in order to keep staying logged in but the page continues to kick me out and it's really annoying

    any suggestions?

    var x = 3600
    var y = 1;
    var z = 300
    x = x-y
    setTimeout("startClock()", 1000)
    function startClock(){
    x = x-y
    setTimeout("startClock()", 1000)
    if(x==z){
    alert("your session is about to expire.");
    } else if (x==0) {
    document.location.href = "logoutFinal.htm";
     
    asddsa1, Apr 6, 2009 IP
  2. Sleeping Troll

    Sleeping Troll Peon

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The maximum timeout is serverside, all you are doing is causing it to log you out sooner by telling the server not to wait.
    You cannot however overide the limit set on the server.
     
    Sleeping Troll, Apr 7, 2009 IP