I am using SA Rules to determine logged in/out:
Rule Name: AdminsUsers
restrict if <?php echo $_SESSION['userActivity']; ?> = 0
allow if <?php echo $_SESSION['userLevel']; ?> In Group AdminsUsers which group members have values 1, 2
My Login Page uses SA Auth User SB to start the following session vars:
Does this info help, or was it what you are looking for? If you need further info let me know.