Enabling two-factor authentication will not log you out of all devices. It will require you to enter a verification code when logging in from an unrecognized device or browser.