Preheat oven to 350°F. Spray 9 inch square baking dish with cooking spray. Peel onions and potatoes. Using a food processor slice onions and layer them first in the dish, sprinkle with 1 cup of the shredded cheese.
Slice potatoes next using the food processor, spread them over the cheese layer. Pour the cup of milk over the potatoes, sprinkle on salt and pepper, dot with butter and add the last layer of cheese.