process Event
Process an event (login, logout, etc).
On success, update the current state and return it. On error, the current state will remain the same.
Process an event (login, logout, etc).
On success, update the current state and return it. On error, the current state will remain the same.