

def filter_expired_cookies(self):
    '\n        Remove any expired cookies from our internal state.\n\n        The browser may send expired cookies, because it does not parse the\n        the ZappaCookie into its constituent parts.\n\n        '
    now = time.gmtime()
    for (name, value) in self.request_cookies.items():
        cookie = ((name + '=') + value).encode('utf-8')
        if (cookie.count('=') is 1):
            continue
        kvps = cookie.split(';')
        for kvp in kvps:
            kvp = kvp.strip()
            if ('expires' in kvp.lower()):
                exp = time.strptime(kvp.split('=')[1], '%a, %d-%b-%Y %H:%M:%S GMT')
                if (exp < now):
                    del self.request_cookies[name]

dataset/ETHPy150Open Miserlou/Zappa/zappa/middleware.py ZappaWSGIMiddleware.filter_expired_cookies/original