Preheat your oven to 350°F (175°C).
In a bowl, whisk together the flour, baking soda, salt, and pumpkin pie spice.
In a separate bowl, beat the softened butter, brown sugar, and granulated sugar together until creamy.
Add the egg, vanilla extract, and cooled espresso to the sugar mixture and beat until combined.
Gradually add the dry ingredients to the wet mixture, mixing until just combined.
Fold in the white chocolate chips if using.
Drop rounded tablespoons of dough onto a baking sheet lined with parchment paper, spacing them about 2 inches apart.
Bake for 10-12 minutes or until the edges are golden and the centers look set but soft.
Let the cookies cool on the baking sheet for 5 minutes before transferring to a wire rack to cool completely.