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?

1 Answer 1


I'm afraid you can't have your cake and eat it too. How will Google know it's the same computer? Even if it is, how will they know it's you're user account? They can't rely on IP address, because those change. The only thing that's reasonable is cookies, since you're probably keeping the physical machine secure from bad actors. (And if you're not, you've got more problems than just giving away access to your email mailbox.)

So I'm afraid, no, there's no way to do what you want. You can either clear the cookies, or bypass 2FA on that computer at next login, but not both.

  • 1
    Yeah, I figured clearing all my cookies would definitely require a new 2FA login with each session, but I was hoping there would be some way to selectively clear the "remember that I'm logged into Gmail" cookie while keeping the "Remember that my 2FA should trust this computer" cookie...
    – tparker
    Commented Jun 23, 2017 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.