How to use ScriptCase Session Timeout (min) in an application

  1. The SC Session Timeout seems to be a very useful tool especially in an application. The time settings are managed in the SC Options/Settings section.
  2. In the same section there are other session options: “To use session in database - Store session data in database. ScriptCase Applications can use session variables stored in the database. This options is very useful when working with session variables and also load balance it also increase environment security.” which seem to be ideal.

a) How does one include item 1 above in my application?

b) There isn’t much if any documentation on what item 2 really does. Can someone please explain what this does and how it will affect the applications?

I did this:

$_SESSION[‘test’] = time() + 10;


if($_SESSION[‘test’] < time())
unset ($_SESSION[‘test’]);
echo “<script>
alert(‘Cierre de sesion por inactividad. Favor inicie sesion nuevamente’);
parent.parent.window.location = ‘…//app_Login/app_Login.php’;
$_SESSION[‘test’] = time() + 10;

but the problem is when the user is working in the frame, in menu app the time is running out, only when it has menu activity the timer is stopped. How can I stop the timer to logout when the user is working in the frames?

I worked this out using the following:
My users when they log in they come to a menu
Then in OnExecute of the menu I have the following code:

if (isset($_SESSION[‘test’]))
if ($_SESSION[‘test’] < time())
echo "<script>
alert(‘Timeout - Please login again’);
parent.parent.window.location=‘location where the user is sent to’;

            $_SESSION['test']=time() + $session_timeout;

This resets itself each time the user clicks on a menu item

Hope this helps

But that is the same script. The main problem is when the user is working in an app inside of the frame menu, the user don’t use menu and work in the frame more than the experation time in menu.

The question is: how can I control the expiration timer in all app.

Try adding your code in the beginning of the onScriptInit event of each application. Then each time the user starts an app, you will evaluate the timer and see whether they can continue to work or be redirected.

Yes that’s correct.