Page 1 of 1

Timeout Issues

Posted: Wed Jul 03, 2013 2:31 am
by wrichards8
Hi all,

I am trying to code a javascript timeout for my website so the user doesn't have their session taken away without warning, The code I have is:
[syntax=javascript]function delay()
{
window.location = "logout";
}

[/syntax]

I also have [syntax=xhtml]<body onload="setTimeout(delay(), 300000);">[/syntax]

My problem is that, when the user page loads, the user is instantly taken to the logout script, instead of after (300000 milliseconds). I'm guessing it has to do with body onload but I would have thought it'd wait. Works fine on my local machine during testing but I put it on the web and it goes screwy. Can someone help?