How to clear all global [VARS] in one go

I would like the user to log in via a login form and have all global vars previously assigned to be cleared, in order to start with a new fresh session.
Any clue ?

sc_apl_reset does the trick

Mmm… Are you sure ?
This macro seems undocumented and it does not work.
Do you mean may be sc_reset_apl_status ?
The latter reset the secury varuiables but not all global variable.,

since all variables are in $_SESSION[‘scriptcase’], try to empty that session variable, a little bit rude, but maybe it works, if you try, let us know if it works.

Globals are not stored with $_SESSION[‘scriptcase’]. They are root level.

Use this to check: echo json_encode($_SESSION)."\n";

There is no SC function to do this, so perhaps it would be best to prefix all of your globals with a common string so you can then loop through them and delete.

@sc it would be good for this function to exist!

1 Like