Announcement

Collapse
No announcement yet.

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

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

    PROBLEM:
    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?

  • #2
    https://www.youtube.com/watch?v=bpR7...16L_eyCp3hNoU6

    Comment


    • #3
      I did this:
      LOGIN APP
      -----------------
      -----onvalidatesuccess--------
      $_SESSION['test'] = time() + 10;



      MENU APP
      ---------------------
      -----------OnExecute----------
      if(isset($_SESSION['test']))
      {
      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';
      </script>";
      }
      else{
      $_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?

      Comment


      • #4
        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:

        ----------------------------------------------

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

        </script>";
        }
        else
        {
        $_SESSION['test']=time() + $session_timeout;
        }
        }

        ------------------------------------------------

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

        Hope this helps

        Comment


        • #5
          Originally posted by Larryh1115 View Post
          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:

          ----------------------------------------------

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

          </script>";
          }
          else
          {
          $_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.

          Comment


          • #6
            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.

            Comment


            • #7
              Yes that's correct.

              Comment

              Working...
              X