Preheat the oven to 300 degrees.
In a large heavy skillet, heat the oil over medium-high heat. Sauté the onions until they are browned, about 5 minutes.
Add the spinach and cook it until it is wilted, 1-2 minutes.
Meanwhile, heat a large skillet over medium heat.
Place 2 tortillas at a time in the skillet (they will overlap). Put a handful of cheese and a spoonful of the onions and spinach in half of each tortilla (staying away from the edges), and fold the tortillas in half, so two tortillas fit in the pan with their rounded edges facing the outside of the pan.
Press the tortillas to flatten them and cook them for 3-4 minutes per side, until the bottoms of the tortillas are golden brown.
Carefully transfer the cooked quesadillas to a baking sheet in the preheated oven so they stay warm until all the quesadillas are cooked. Serve them hot, sliced in wedges, with salsa and/or guacamole, if desired.