Security login app settings not set

Hi
for some unknown reason security access settings per app stopped working in production
on dev it works. it also still works on production cached page, but not in the crome incognito mode and not by some users.

symptoms - the user logs and apps configuration query is ok, then sc sets athorisation per app.
it seems to run, but the settings are not set. the user cannot access secured apps.

i recopied PROD folder to production.
have no idea where to look at , or what could be the reason.

this part of standard security app seems to run but nothing happens / sc_apl_… macros do not work/ but also do not give error.

how to debug this ?

$rs->Close();

foreach($arr_perm as $app => $perm)
{
	sc_apl_status($app, $perm['access']);
	
	sc_apl_conf($app, 'insert', $perm['insert']);
	sc_apl_conf($app, 'delete', $perm['delete']);
	sc_apl_conf($app, 'update', $perm['update']);
	sc_apl_conf($app, $perm['export'], 'xls');
	sc_apl_conf($app, $perm['export'], 'word');
	sc_apl_conf($app, $perm['export'], 'pdf');
	sc_apl_conf($app, $perm['export'], 'xml');
	sc_apl_conf($app, $perm['export'], 'csv');
	sc_apl_conf($app, $perm['export'], 'rtf');
	sc_apl_conf($app, $perm['export'], 'json');
	sc_apl_conf($app, $perm['print'], 'print');

}