title: find_no_duplicates raise KeyError in Python requests library
body: <p>This piece of code worked before (when I developed it in May 2015, so maybe my Python/Requests version is causing the issue). I am currently on <code>requests version: 2.9.1</code> I have getting the following error in my code:</p>
  
  <pre><code>Traceback (most recent call last):
    File "./add.py", line 98, in &lt;module&gt;
      'SESSID':term.cookies['SESSID'],
    File "/usr/local/lib/python2.7/site-packages/requests/cookies.py", line 276, in __getitem__
      return self._find_no_duplicates(name)
    File "/usr/local/lib/python2.7/site-packages/requests/cookies.py", line 331, in _find_no_duplicates
      raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
  KeyError: "name='SESSID', domain=None, path=None"
  </code></pre>
  
  <p>Line 98 in <code>add.py</code> refers to the following:</p>
  
  <pre><code># Grab the Add/Drop Class page cookies                                
  ad_cookie = {                                                         
      'SESSID':term.cookies['SESSID'],                                  
      'IDMSESSID':username                                              
  } 
  </code></pre>
  
  <p>Just to make sure that the particular cookie in that page was not removed or missing, I checked the cURL for when I hit that page, and surely enough, both <code>SESSID</code> and <code>IDMSESSID</code> were in that cURL request.</p>
  
  <p>Wondering what the issue is?</p>
  
  <p>EDIT:</p>
  
  <p>I've added some more code:</p>
  
  <pre><code>username = info['username']                                            
  password = info['password']                                            
  term_in = info['term_in']                                              
  
  login_url="https://school.edu/cas/login?service=https%3A%2F%2Fschool.edu%2Fc%2Fportal%2Flogin"
  
  # Fake random user agent generator                                     
  ua = UserAgent()                                                       
  
  # Persist a session                                                    
  with requests.Session() as s:                                          
  
      # Call this URL to get our initial hidden parameter variables      
      # In particular, the `lt` variable changes every time [I'm not     
      # sure how often, but it's necessary every time you login]         
      page = s.get('https://school.edu/web/university')              
  
      # Convert page to string for easy scraping                         
      tree = html.fromstring(page.text)                                  
  
      # Grab our unique variables from these particular XPaths           
      # Yes, the XPaths are a MESS, but that's because School's websites 
      # are a mess.                                                      
      lt = tree.xpath('//*[@id="fm1"]/div[4]/input[1]/@value')           
      execution = tree.xpath('//*[@id="fm1"]/div[4]/input[2]/@value')    
      eventId = tree.xpath('//*[@id="fm1"]/div[4]/input[3]/@value')      
      submit = tree.xpath('//*[@id="fm1"]/div[4]/input[4]/@value') 
  
      l_payload = {                                                      
          'username':username,                                           
          'password':password,                                           
          'lt':lt,                                                       
          'execution':execution,                                         
          '_eventId':eventId,                                            
          'submit':submit                                                
      }                                                                  
  
      # Login page cookies                                               
      l_cookies = {                                                      
          'JSESSIONID':page.cookies['JSESSIONID'],                       
          'IDMSESSID':username                                           
      }                                                                  
  
      # Login page headers with a fake user-agent generator              
      l_headers = {                                                      
          "Referer":"https://login.school.edu/cas/login?service=https%3A%2F%2Fschool.edu%2Fc%2Fportal%2Flogin",
          "User-Agent":ua.random                                         
      }                                                                  
  
      # Now we login to School Connect, School's single-sign-o           
      # for all its web apps like School Learn, School One, etc          
      # For more info in this:                                           
      # https://www.school.edu/irt/help/a-z/schoolConnect/               
      s.post(                                                            
          login_url,                                                     
          data = l_payload,                                              
          cookies = l_cookies,                                           
          headers = l_headers,                                           
          allow_redirects = True                                         
      )                                                                  
  
      # Go to the "Add/Drop Class" link within School One                
      # to grab the SESSID cookie which will allow us to                 
      # add and/or drop classes                                          
      term = s.get('https://bannersso.school.edu/ssomanager/c/SSB?pkg=bwszkfrag.P_DisplayFinResponsibility%3Fi_url%3Dbwskfreg.P_AltPin')
  
      #print html.fromstring(term.text)                                  
      #sys.exit(0)                                                       
  
      # Grab the Add/Drop Class page cookies                             
      ad_cookie = {                                                      
          'SESSID':term.cookies['SESSID'],                               
          'IDMSESSID':username                                           
      }
  </code></pre>
  
  <p>EDIT 2:</p>
  
  <p>I printed out <code>term.headers</code> and the following is the result:</p>
  
  <pre><code>{'content-length': '8624', 'content-language': 'en', 'set-cookie': 'TESTID=set, SESSID=;expires=Mon, 01-Jan-1990 08:00:00 GMT, PROXY_HASH=;expires=Mon, 01-Jan-1990 08:00:00 GMT', 'keep-alive': 'timeout=5, max=100', 'server': 'Oracle-Application-Server-11g', 'connection': 'Keep-Alive', 'date': 'Thu, 31 Mar 2016 16:00:30 GMT', 'content-type': 'text/html; charset=UTF-8'}
  </code></pre>
  
  <p>It seems like there are no cookies at all.</p>