Modified if statement to check if cookiejar is not None, because cookiejars support the iterator
protocol. If you create a cookiejar and supply it to the constructor it will have no cookies to
iterate and therefore cookiejar will be 0 and "if cookiejar:" will be False.