Heat the oil in a large skillet over medium heat. Saute the onions until soft and caramelized, about 25 minutes. Season with salt and pepper. Transfer the onions to a plate.
Generously butter both sides of each bread slice. In between two bread slices, pile the caramelized onions between two layers of cheese.
Heat a large skillet or griddle over medium-low heat. Cook the sandwiches, flipping once, until the cheese is melted and the bread is golden brown, 2 to 3 minutes per side.