title: My pickled cookies won't work in selenium - python?
body: <p>I want to open up a selenium instance then login in to any site manually and then save the session. when the browser opens and goes to the login page I login and then I go to the taskbar in firefox and then preferences then security then tick remember login for sites.</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  import pickle
  
  driver = webdriver.Firefox()
  driver.get("https://twitter.com")
  continu = raw_input("Press Enter when you've logged in")
  pickle.dump(driver.get_cookies(), open("/home/ro/A_Python_Scripts/twitter/twitter_loggins.pkl", "wb"))
  </code></pre>
  
  <p>when I open the browser in another python file and set the webdriver with the cookie it doesn't remember the login info. I'm trying to make it so it logins automatically.</p>
  
  <p>EDIT:
  This is my other file that I run to load the cookie</p>
  
  <pre><code>def load_cookie(file1):
      with open(file1, 'rb') as cookie:
          return pickle.load(cookie)
  
  driver = webdriver.Firefox()
  cookie = load_cookie("/home/ro/A_Python_Scripts/twitter/twitter_loggins.pkl")
  driver.add_cookie(cookie)
  driver.get("https://twitter.com")
  </code></pre>