Remove $_SESSION['authGroup'] variable and add 'modifydate' column.
Set session variables as set in library/auth.inc script.
Remove $_SESSION['authGroup'] variable and use addPnote() function to add note.
Modify code to add copay in ar_activity and ar_session tables.