There is a weird issue with Firefox/Chrome browser where if I close it using the red close button, it loses all the opened tabs. If I right click on it in the Dock and "Quit", it remembers the session next time I open it.

So, is there a way to make the "close" button behave as "quit" if the window I’m closing is the last one open?