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]