MDL-19774 fixed incorrect session init in cron - credit goes to Jay Knight