Login/Logout functionality with session validation