Get session, existing or new.

def get_session(username, password, cookie_path=COOKIE_PATH, cache=True,
                cache_expiry=300, cache_path=CACHE_PATH, driver='phantomjs'):
    """Get session, existing or new."""
    class USPSAuth(AuthBase):  # pylint: disable=too-few-public-methods
        """USPS authorization storage."""

        def __init__(self, username, password, cookie_path, driver):
            """Init."""
            self.username = username
            self.password = password
            self.cookie_path = cookie_path
            self.driver = driver

        def __call__(self, r):
            """Call is no-op."""
            return r

    session = requests.Session()
    if cache:
        session = requests_cache.core.CachedSession(cache_name=cache_path,
                                                    expire_after=cache_expiry)
    session.auth = USPSAuth(username, password, cookie_path, driver)
    session.headers.update({'User-Agent': USER_AGENT})
    if os.path.exists(cookie_path):
        _LOGGER.debug("cookie found at: %s", cookie_path)
        session.cookies = _load_cookies(cookie_path)
    else:
        _login(session)
    return session