Heat olive oil in a skillet over medium heat. Add onions and cook for about 10 minutes, stirring occasionally, until golden and just caramelized. Sprinkle with salt.
Add sliced apple and cook for 3 to 4 minutes, until softened and tender. Remove from heat.
Spread mayonnaise on one side of each slice of bread.
On the uncoated side, layer a slice of cheddar, the onion and apple mixture, another slice of cheddar, then top with bread.
Place sandwiches in a skillet over medium heat. Tent loosely with foil or cover with a lid to help the cheese melt. Cook 4 to 5 minutes per side, lowering heat as needed to prevent burning.
When bread is golden and crispy and cheese is fully melted, remove, slice and serve immediately.