I use Gmail's two-factor authentication (with Firefox). I would like it to remember certain trusted computers (across browser sessions) so that I don't have to use it every time I log into Gmail on those computers. As far as I can tell, this requires saving Gmail's cookies across browser sessions. But for security and privacy reasons, I would also like Gmail to automatically log out when I close my browser. As far as I can tell, this requires clearing Gmail's cookies between browser sessions.
Is there any way to either:
(a) clear Gmail's cookies between browser sessions but still get Gmail's 2FA to remember my computer, or
(b) save Gmail's cookies between browser sessions, but still get it to log out when I close my browser?