ESDEV-2145 Fix bug #5809: Session ID Disclosure

Fix parameters array formation.
(cherry picked from commit 8b39aa8)