Normally this console command should work. Are you in a Mendix application and do you already have a session? For instance, if it's a Mendix application that disallows anonymous users and you're not logged in yet, it will not count as having a session.