No announcement yet.

RESOLVED Lost session variable value

  • Filter
  • Time
  • Show
Clear All
new posts

  • RESOLVED Lost session variable value

    I'm Frank

    I have the following problem create an application with a login form that validates user data and then store them in session variables which are then used in other applications in the system I created that need to know that user has entered to display the information.

    the user gains access without problems and see what personal information but after using the different menu options available to him in a time period less than 2 min the values of session variables are lost

    someone could say that I am doing wrong?

    Here Login Form Code Example

    sc_lookup(dtget_logged_user,"SELECT user_id
    FROM tb_mst_login
    WHERE email = '$user_name' OR username = '$user_name'
    AND password = '$encrypted_pass'");


    [login_user_id] = {dtget_logged_user[0][0]};

    [user_type] = {dtget_logged_user[0][1]};
    $isEmail_Verify = {dtget_logged_user[0][2]};
    $isValid_user = 1;

  • #2
    Re: Lost session variable value

    It is hard to say ... I may get arguments on this, but I prefer to create my own session variables instead of using the macros in SC. You have more control and all sc_set_global is doing is creating a session variable for you anyway. It is possible that your variable is colliding with your field name variable and it overrides it. I have seen this many times.

    Try and use PHP when possible instead of relying on sc_macros.


    is a lot cleaner than


    And you are guaranteed not to have variable collision.

    you can then use:
    print_r($_SESSION['user']) to view all elements of user



    • #3
      Re: Lost session variable value

      thank you very much for your advice helped me a lot. Reflections on overwriting your variables reminded me that I was sometimes described as a session variable, post and get in the configuration of the application. change it only as session variables everything works perfectly

      Thanks again Scott


      • #4
        Re: RESOLVED Lost session variable value

        Is is possible to make session varaible Read only..?

        I have [v_login] varaible declared in the Login screen and making global to across the project sc_set_global([v_login])

        When we pass the variable to other application using sc_redir macro It gets modified.. The fun here is why should it get modified. The code is as below

        sc_redir(form_users_int,v_login=$wflogin;v_usernam e=[v_username];wf_login=$wflogin,"_self");

        Issue :

        The Variable is availble in all the application, That is fine, but when some applications modifies [v_login] then It get modified.

        for ex: I had logged in as Dhana and In the User Manager screen, I use the same variable name to passs to Form application in which Editing other username say "Ben" then the [v_login] holds the new value not the orginal One

        How to make session varaible readonly ..>?

        Any one has more view..! Please share..!



        • #5
          Re: RESOLVED Lost session variable value

          Hi Dhana,

          [quote author=dhanam4 link=topic=1723.msg6275#msg6275 date=1286616372]
          Any one has more view..! Please share..!

          do what Scott suggests ... this is the best way.
          Best regards: - Reinhard -

          I use ScriptCase 8 Enterprise Edition, Version 8.(latest)


          • #6
            Re: RESOLVED Lost session variable value

            The variable only is modified if you change the value in any part of your project.