XMS: rebase on top of master
sessionUtils: session saving bugfix

Fixes a failure when session file doesn't exist.
It ensures that it exists first before trying to write.