Click to See Complete Forum and Search --> : page with autorefresh doesn't timeout


agustina_s
05-03-2004, 09:46 PM
Hi...

I have web application consist of 3 frame.
One of the frame (the header) which is an aspx file, is refreshed every 5 minutes. I need the autorefresh to check for alerts from the server.
The auto refresh is implemented using javascript as follow:


<script language="JavaScript">
<!--
var time = null
function move() {
window.location.href = "Header.aspx";
}
//-->
</script>
</HEAD>
<body onload="timer=setTimeout('move()',300000)" MS_POSITIONING="GridLayout">

Because of this auto refresh header, my asp.net application never timeout even though the user leave the browser for a long time.
The timeout in the web application is set during login as follow :
(I am using Forms Authentication)
Dim authTicket As FormsAuthenticationTicket = New FormsAuthenticationTicket(1, user_id, DateTime.Now, DateTime.Now.AddMinutes(60), False, role)

I am setting the timeout to 60 minutes.
However, even when the user leave the browser for more than 60 minutes, the page doesn't timeout because of the auto refresh header.

Is there anyway to solve this problem?
Thank you in advanced.
Sincerely

PeOfEo
05-03-2004, 10:48 PM
1) I would never use frames, as they are bad way to lay out your application because they will cramp your ability to design, and they are notorious for inaccessability.
2) do the refresh server side with a http header, do not use java script for this. If you do not do it with a header, do it with a meta refresh.
<META HTTP-EQUIV="refresh" content="2;URL=http://www.yoursite.com">
Javascript should be kept to aesthetics and almost nothing more. 13% of the internet according to last year's stats did not support java script, so it is a good idea to use it as little as possible. Incidently that code I posted above for a meta refresh can also be used for a meta redirect, just put the new url in their for the url.

agustina_s
05-04-2004, 12:57 AM
Hi..
Thanks..
Actually I am using frame because I want to refresh the header every 5 minutes. I don't want the other part to be refreshed.

So.. If I used meta refresh, will it detect the timeout?

PeOfEo
05-04-2004, 01:14 AM
Originally posted by agustina_s
Hi..
Thanks..
Actually I am using frame because I want to refresh the header every 5 minutes. I don't want the other part to be refreshed.

So.. If I used meta refresh, will it detect the timeout? timeout of what? The session? I use the session and cookies to store data and reset session variable from the cookies if I do not want my user's data to go away when the session expires.