Jump to content

This topic is 7978 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

hello People!

I know this might not be news to some but I just though of using this function.

LogOut user (close the frame or window) after an X amount of time!

Someone else might benifit from it so here it is:

  Quote

<script>

var myMinutes=1; // declare how many minutes you want allowed on the site/page

var myTime = myMinutes * 60; // convert time from minutes into seconds

var LogOut = myTime * 1000;// convert time from seconds into milliseconds

t = null;

function AutoLogOut()

{

t = setTimeout("top.window.close()",LogOut);// if you use frames -if no Frames use: window.close

}

</script>

<body onLoad="AutoLogOut();">

adjust your "minute needs"!

Another approach would be (if you are using cromeless windows) is to redirect user to either blank-not important-page or Login page by using:

  Quote

.....

..

<meta http-equiv="refresh" content="60;URL=Login.html">

</head>

where user is redirected to Login page after x (60 here) seconds

There my little contribution smile.gif

This topic is 7978 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.