session_change logic moved from diwacs to state (the correct place for it).