Fix sessions refs #705
Simplify condition.
Merge branch 'session_fix' into 1.3