remove spaces when a session is enabled.