Hello. I'm having session timeout issues:(
I use javascript to timeout each ASP page and redirect the user back to the log on screen.
Each page has an inline frame in its toolbar which contains a small page, which basically just links to itself to refresh the JS timer in the main page.
--------------------------
----------
----------
----------
----------
<iframe name="main" src="refreshTimer.asp" width=200 height=15 scrolling=no frameborder=no></iframe>
--------------------------
----------
----------
----------
----------
refreshTimer.asp is a really simple page, just runs the javascript function and has a link back to itself.
--------------------------
----------
----------
----------
----------
<HTML>
<HEAD>
<!script for timer->
<SCRIPT>
<!-- Begin
// Take user here after session timed out
timedouturl = "../SLogOff.asp";
function Display(min, sec) {
var disp;
if (min <= 9) disp = " 0";
else disp = " ";
disp += min + ":";
if (sec <= 9) disp += "0" + sec;
else disp += sec;
return (disp);
}
function Down() {
sec--;
if (sec == -1) { sec = 59; min--; }
window.status = "Session will time out in: " + Display(min, sec);
if (min == 0 && sec == 0) {
alert("Your session has timed out.");
window.parent.location.hre
f = timedouturl;
}
else down = setTimeout("Down()", 1000);
}
function timeIt() {
min = 10;
sec = 00;
Down();
}
// End -->
</script>
</HEAD>
<BODY OnLoad="timeIt()" class='toolbar'>
<a href="refreshTimer.asp" target="main">|Reset Timeout|</A>
</BODY>
</HTML>
--------------------------
----------
----------
----------
----------
This has been working really well all through the testing phase, but now, suddenly, the day before the system goes live, it's started to behave oddly!
1)Inconsistently, the inline frame is sometimes displaying SLogOff.asp!
Can inline frames go weird and target themselves, instead of main?
2)The session seems to think its timed out after 5 minutes, although its not my javasscript doing it as there's no warning msg and the countdown is still on 5 or 6 minutes. Clicking on any link takes you back to the log on page, as if the session variables weren't there any more, but then with judicious use of back button you can get the session back again- so it's not really timed out at all!
Can session variables temporarily become unavailible?