Slowly stir in 1 cup of cream (or milk) and whisk until smooth.
Stir in the remaining cream, salt and pepper. Whisk constantly until the mixture starts to thicken. This will take 3-5 minutes.
Remove the white sauce from the stove.
Preheat the oven to 400 degrees Fahrenheit.
Spray a 9x13 pan with cooking spray.
Place half of the potatoes in the greased pan. Cover them with the onions and half of the sauce.
Place the remaining potatoes in the pan and then pour the remaining sauce overtop.
Cover the pan with foil and bake for 40 minutes.
Uncover the pan and bake for an additional 15-20 minutes or until the top of the potatoes are lightly browned and the potatoes are tender. The exact timing will depend on how thick you have cut the potatoes.