ESDEV-2145 Fix bug #5809: Session ID Disclosure

Fixing tests.
(cherry picked from commit 86b8452)