Added logout controls and switching

Added logout controls and switching between the controls based on the
session details.