if we are in a cron action there is no session

Add conditional structures