'Retrieves login cookie
:param str username:
:param str password:
:param bool force: if True, then retrieve a fresh cookie instead of looking in the DB
:return:'

def get_login_cookie(self, username, password, force=False):

    if (not force):
        with Session() as session:
            saved_cookie = session.query(FileListCookie).filter((FileListCookie.username == username.lower())).first()
            if (saved_cookie and saved_cookie.expires and (saved_cookie.expires >= datetime.datetime.now())):
                log.debug(u'Found    valid    login    cookie')
                return saved_cookie.cookie
    url = (BASE_URL + u'takelogin.php')
    try:
        log.debug(u'Attempting    to    retrieve    FileList.ro    cookie')
        response = requests.post(url, data={u'username': username, u'password': password, u'login': u'Log    in', u'unlock': u'1'}, timeout=30)
    except RequestException as e:
        raise plugin.PluginError((u'FileList.ro    login    failed:    %s' % e))
    if (u'https://filelist.ro/my.php' != response.url):
        raise plugin.PluginError(u'FileList.ro    login    failed:    Your    username    or    password    was    incorrect.')
    with Session() as session:
        expires = None
        for c in requests.cookies:
            if (c.name == u'pass'):
                expires = c.expires
        if expires:
            expires = datetime.datetime.fromtimestamp(expires)
        log.debug(u'Saving    or    updating    FileList.ro    cookie    in    db')
        cookie = FileListCookie(username=username.lower(), cookie=dict(requests.cookies), expires=expires)
        session.merge(cookie)
        return cookie.cookie
