Warn user when they're in the wrong session.

Includes tests, and fixes to existing tests.