Combine the cream cheese, cheddar cheese, pineapple, and hot sauce, if using, and mix well. Spread the mixture on all the slices of bread. Top half the bread slices with ham and then place the other halves on top.
Heat a non-stick skillet over medium-low heat and spray with cooking spray. Spread mayonnaise on the outside of one side of each sandwich and place on the skillet, mayonnaise side down. Spread the top slice with mayonnaise. Cover the skillet and cook until the bottom is golden brown, about 3 minutes. Flip the sandwiches and cook for another 3 minute or until the bottom is golden brown and the cheese melts. Keep warm in the oven while cooking the rest of the sandwiches.