Vapour barrier goes to the warm side......The theory is to keep the moisture laden air inside the building from possibly migrating through your insulation contacting touching the cold surface of an exterior wall. Sprayfoam does not need an extra vapour barrier since it is closed cell and seals the stud cavity totally so no moisture can get through.