process Event
Process an event (login, logout, etc).
On success, returns the new state. On error, the state will remain the same.
Process an event (login, logout, etc).
On success, returns the new state. On error, the state will remain the same.