title: losing cookies when navigating to a new page with selenium
body: <p>I'm using Selenium with Python to log onto a page, and then immediately jump to another page in the same tab. I need the credentials of the page to be saved, but what happens is they are lost when I move to the new page.</p>
  
  <p>I have tried 2 things - one is to save the cookies after the input.send_keys(keys.ENTER) command in the code below using pickle.dump, and then loading the same cookies after the new page loads. The other is to just load a Firefox profile I made after saving the cookies.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  import pickle
  from selenium.webdriver.firefox.webdriver import FirefoxProfile
  
  profile = FirefoxProfile("C:\\Users\\ace\\AppData\\Local\\Mozilla\\Firefox\\Profiles\\l4piuit9.ace")
  driver = webdriver.Firefox(profile)
  driver.get("https://forums.the-elite.net/index.php?action=login")
  
  # #handle the form data and log in by forcing an enter
  inputElement1 = driver.find_element_by_name("cookieneverexp").click()
  inputElement2 = driver.find_element_by_name("user")
  inputElement2.send_keys('REMOVED')
  inputElement3 = driver.find_element_by_name("passwrd")
  inputElement3.send_keys('REMOVED')
  inputElement3.send_keys(Keys.ENTER)
  
  #save the cookies, they don't transfer over when navigating to a new page
  #pickle.dump(driver.get_cookies(), open("elite.pkl", "wb"))
  
  #new page / poll
  driver.get("https://forums.the-elite.net/index.php?action=votelog;topic=22504")
  
  #get the cookies
  #cookies = pickle.load(open("elite.pkl", "rb"))
  #for cookie in cookies:
  #    driver.add_cookie(cookie)
  </code></pre>
  
  <p>None of these seem to do anything. I thought maybe a delay would be required so I included an implicit_wait of 10s but that did not seem to make a difference.</p>
  
  <p>What is the cause of this and how can I resolve it?</p>