Don't set the session name in CLI or when sessions are deactivated

It doesn't make much sense to set the session name in that case.

Change-Id: I4cf237d79061d146091c3409b7ac3e19136f3fb6
Merge "Don't set the session name in CLI or when sessions are deactivated"