Preheat oven to 350°.
In a small saucepan over medium-high heat, melt butter, add garlic, keep stirring and cook until fragrant (do not burn). Add flour, salt, and pepper. Cook and stir until smooth.
Gradually whisk in milk, add ground mustard and thyme. Bring it to a boil, and keep stirring until the sauce is thickened (for about 2 minutes). Remove from the heat, and stir in the cheese until melted.
Coat a 13″ x 9″ baking dish with cooking spray then spread half of the sliced potatoes on it. Spread half of the sliced onions on top of the potatoes and layer up with ½ portion of the cheese sauce.
Repeat this process once and top it all with additional ¼ cup cheddar cheese and parmesan cheese.
Cover the baking dish with foil and cook for 45 minutes. Then uncover and continue to cook for 15 - 20 minutes, or until potatoes are browned and tender.
Serve with chopped chives (optional)