views:

371

answers:

2

Hi,

A classic page consists of 4 frameset. if all 4 frameset is inactive then timeout to login page.How to set timeout for classic asp page with frameset.

+1  A: 

By Deafult session time out is 20 mins. You can change it by adding the following code

Session.Timeout (= intMinutes)
ex: Session.Timeout= 10

in your asp page.

Shoban
I think Session.TimeOut is a property. It should be Session.TimeOut=10.
adatapost
oops sorry! changed.
Shoban
A: 

You could have some JS in you page which counts down to your session timeout time (see Shobans answer for how to set that). Then if the JS timesout (ie reaches its session timeout) then you could redirect them (client side) to your login page, busting out of the frames as you did so. Something like this should do it:

<script type="text/javascript">

// Get the current server side timeout (times 1000 to convert it into JS milliseconds
var timeout = <%= Session.TimeOut * 1000 %>;

// This is the function that does the framebusting and redirecting to your login page
function GoToLogin() {
  top.location.replace( "yourloginpage.asp" );
}

// Set it up to run when the timeout expires
setTimeout( GoToLogin, timeout );

</script>

Should your user do anything to reload the page then your timer gets reset, nice. Don't put this in all your frames though, you only really need it in your main one, you don't want it in a navigation frame which might not get any action your you will always timeout!

An addition might be to get the page to just refresh itself, if its timed out then the server-side code can redirect the user to the login page (this would appear in the frame though, so your login page would need a frame buster anyway which would use the top.location trick above).

Pete Duncanson