Preheat oven to 350 degrees F.
In a large pot boil water for green beans. Boil green beans for 3-4 minutes, just enough to parboil them. Drain beans and rinse with cold water to stop the cooking. Pat dry. Beans will finish cooking in oven.
In a large pan over medium heat, add and melt 2 tbsp of butter. Sprinkle flour into butter, then immediately whisk to combine well, for approximately one minute. Add sugar and salt, and mix to combine. Reduce heat to low and add cream cheese. Mix until well combined and smooth. Turn off heat and add in sour cream, stirring until smooth. Stir in cream until well combined.
Combine green beans and cream mixture, gently mixing together to coat well.
Transfer green beans to a 13x9 baking dish that has been sprayed with non-stick cooking spray. If desired, sprinkle cheese over top of casserole. In a separate bowl combine remaining melted butter with cracker crumbs or fried onions. Sprinkle mixture over casserole. Bake for approximately 30 minutes or until top is bubbly and cheese is starting to brown.