#1026. Ensuring that sessions are not used when we are not supposed to
be using them.