Improve log in/log out process using CAS ticket.