Preheat the oven to 180°C/350°F (fan 160°C)
Line a baking sheet with parchment paper or a baking silicone mat.
Coat the onion slices with olive oil in a small bowl and set them aside.
Cut each sheet of pastry into 4 segments so you have 8 in total. (See note 4)
Transfer each pastry segment to the lined baking sheet at least 1 inch (2 ½ cm) apart.
If they can't all fit on a single baking sheet, simply work in batches, baking according to the amount of space you have in your oven.
Use a knife to make a border about half an inch (13mm) in from the edge of each pastry. Be careful not to cut all the way through the pastry.
Then, use a fork to gently pierce within the border of each pastry multiple times.
Evenly spread cream cheese at the center of each pastry square. Sprinkle a small portion of shredded cheese over the cream cheese layer.
Arrange the onion slices coated in oil, along with tomato slices or halves, on top of the shredded cheese layer.
Brush melted butter around the edges (border) of each pastry.
Sprinkle sesame seeds(if using over the brushed edges.
Bake for 25-30 minutes or until the puff pastry crust is golden brown on the bottom and cooked through.