Maybe this will help you.
and
and instead of using * <?php echo $_SESSION['scnameId'] ?> use the Security Identity via server connect.