In a pot, saute onions and corn in the butter over medium heat until tender, about 5 minutes.
Mix in the flour, and then slowly pour in the stock stirring steadily. Bring to a simmer, and then add the potatoes, bay leaf and thyme. Simmer until potatoes are tender, about 20 minutes. Stir in the milk or cream and season to taste. Return just to a simmer and then serve. Garnish with chopped parsley or chives.
Note: To make an even heartier version of this soup add 1/4 pound of chopped, smoked ham when you add the