Proper procedure to logout

Planning to use dynamic menu. The “exit” (leave) option shown on the standard menu does not seem to work with dynamic menus. I’m thinking I need to do this:

  1. Reset global vars (sc_reset_global)
  2. Reset security (sc_reset_apl_status)
  3. Add logout event to log (sc_add_log)
  4. Remove from logged users (sc_user_logout)
  5. Redirect to login (sc_redir)

Or … Do a php session destroy?

Not having a lot of luck finding good documentation on this.

Wondering if others might share their experience.