How can I stop Gmail from keeping me logged in after I close the browser?

Change back to the old default behavior

Aha! As this blog post documents (inspired by this podcast):

It appears that for a while now, both Firefox and Chrome have, for the convenience of their users, restored session cookies between browser shut down and restart. This is convenient, but insecure. Only persistent cookies should restore in this way. A common example of the usage of persistent cookies is when you check “keep me logged in” or “remember me” when logging into a site.

Neither Mozilla nor Google seem inclined to revert to the correct secure behavior that IE has kept.

A case where IE is right! Egads, where are my heart pills!?

Here's how he shows to fix it.

Firefox

Browse to about:config, enter ‘sessionstore’ in the search box, and change browser.sessionstore.privacy_level from 0 to 2.

Chrome

Under "On Startup", don't select "Continue where I left off". Also:

Browse to chrome://flags, Press CTRL-F and enter ‘disable better’ to jump to the “Disable Better session restore” flag. Enable it.

For latest chrome version > 33. you need to open chrome://settings/content and select 'Keep local data only until you quit your browser' also in chrome://settings make sure option Continue running background apps when Google Chrome is closed is unchecked otherwise chrome will keep running in background and will not delete cookies