Check for possibility that 'sessionid' is not set

Fixes a server exception when 'sessionid' isn't set.