- Preheat oven to 400°F. Spray 9-inch square or round shallow baking dish with nonstick spray.
- Put ﬂour in medium saucepan and gradually whisk in milk until smooth. Add garlic, rosemary, thyme, salt, and pepper; bring to simmer over medium heat. Cook, stirring, until sauce is consistency of heavy cream and no ﬂoury taste remains, about 5 minutes. Stir in cream cheese and cook, stirring, until melted, about 2 minutes; stir in Parmesan.
- Put potatoes into large bowl; add cheese mixture and stir until coated evenly. Pile potatoes into prepared casserole dish, arranging top layer of potatoes.
- Cover pan with foil; bake 1 hour. Uncover and bake until potatoes are tender and browned on top, about 35 minutes longer.
- Per serving: generous 1 1/4 cups
If the gratin doesn't get as browned on top as you would like, place it under the broiler for a couple of minutes.