Multidimensional Session Variables

Hi,

I trying to figure out how session is managed in scriptcase both in dev and prod environment especially since i think theres too little documentation about this.

In scriptcase, I believe global variables are created by something like this:

[prefix_sample] = ‘1234’;
then theres the option to choose 1) session 2) post 3) get, then IN/OUT.
then to use this global variable, just call it like this:
$var_test = [prefix_sample];

everytime a global variable is created, it is added and can be checked via the development menu scriptcase>application>data session
each created global variable can be seen in the variable column, meaning, the more global variables created, the more will be listed there.

But take note in the listed data session related to ‘scriptcase’ variable - check the pic…
You can see in the value that there seems to be sub values…
I think those are Multidimensional Session Variables
if i understand it right, when you unset the main index session variable, in this case the variable ‘scriptcase’, all other variables under that will be unset.

i think in PHP, it is created like this:
$_SESSION[‘user_id’] = 1;
$_SESSION[‘user_id’][‘login’] = ‘demo’;
$_SESSION[‘user_id’][‘age’] = ‘18’;
$_SESSION[‘user_id’][‘gender’] = ‘M’;

and called like this:
$my_id = $_SESSION[‘user_id’];
$my_login = $_SESSION[‘user_id’][‘login’];
​​​​​​​$my_age = $_SESSION[‘user_id’][‘age’];
$my_gender = $_SESSION[‘user_id’][‘gender’];

Now that’s what i want to know. how do we do this in scriptcase? create, call, manage, unset these Multidimensional Session Variables so that when i unset the user, for example, all his session data will be unset also
and if I unset $_SESSION[‘user_id’], will the rest would be unset also?
[ATTACH=JSON]{“data-align”:“none”,“data-size”:“medium”,“data-attachmentid”:86444}[/ATTACH] ​​​​​​​

Screen Shot 2019-02-05 at 08.17.02.jpg

Hi again,

In addition to the above earlier post, im trying to use or call a session variable in the menu app. I know how to use a scriptcase global variable and simply call it in the menu like this: [glo_sample]

When i try this below, i always have error.

//variable which i want to use instead of [glo_sample]
$_SESSION[‘user_id’][‘sample_only’]

//error
Parse error: syntax error, unexpected ‘’ (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /Applications/Scriptcase/v9/wwwroot/scriptcase/app/project/menu_app/index.php on line 2082

//my work around so far is to set scriptcase global variable format before the menu app and this is what im trying to remove to avoid redundancy
[glo_sample] = $_SESSION[‘user_id’][‘sample_only’];