

The screenshot below shows that session cookies are indeed not stored in cookies.sqlite and thus do not appear in the profile when used by Selenium. To support this feature Firefox records session data within the Firefox profile folder. You can also set Firefox to always restore your previous session on startup. If the stay-logged-in option is not enabled the session is destroyed upon closing my browser and thus Selenium cannot restore it either. Like most web browsers Firefox includes a Session Restore feature allowing your currently open windows and tabs to be restored in the event of a forced-restart or crash. When I run this script after having logged into gmail with the stay-logged-in option enabled, then Selenium is able to access my inbox. I used the following script to test this out with gmail, from selenium import webdriverįp = webdriver.FirefoxProfile('/Users//Library/Application Support/Firefox/Profiles/fault') Many sites, however, offer a remember-me or a stay-logged-in option on their login page which, if used, will store a persistent cookie by which the session can be restored. Note that cookies are among these, however session-cookies are not stored in cookies.sqlite which is the reason Selenium cannot rebuild your session since it does not appear in the profile. On is a list indicating what information is actually stored in your profile. I think your issue has more to do with session cookies vs. Selenium indeed uses a copy of the profile, though that ought not to cause any problems.
