Preheat oven to 350 degrees. Grease a 7 inch square baking pan or casserole dish. Spread the cream cheese on the bottom of the pan. Top with corn, pressing the corn into the cheese. Season to taste with salt and pepper. Spread the onions evenly over the top. Bake for 30 minutes.