I am using Redis in NodeJS for server session management.
thinking about putting frequently used server-side variable in session variables. Instead of trying to create all of them as individual variable I thought of making an object and putting the variables inside as shown below;
my_obj.var1 is not a valid name according to set session step.
Q2. Will it be more efficient if I used an object instead of individual variables and if I set variable type to number instead of default text?
the above is few years old now hoping things might be different now;
Q3. additionally, I have thought about putting resolved* permissions (resource id)’s into an array and into session memory as an array. Hoping server actions can use them in expression to check if permission exists. What is the opinion on this approach?
*(permissions are retrieved based on conditions on different tables rather than from a ready to consume table that has associate user_id with permissions)
Wappler doesn't support dot-notation. If you want to do that strategy, you need to Set Session on the entire object you created.
Don't complicate things, you'll find yourself fighting with Wappler...
Q2
$_SESSION is already an object, there's no efficiency gain
Q3
I'm not familiar with Wappler permission system, so I can't provide advice in this area. However, perhaps a "HashMap" (keyed array) would be better than a regular array, but your regular array approach can also work