option for session use or not
(cherry picked from commit 2c89bc7)