(self, c, delta)
return c.output(header="").strip()
Takes a cookie string c and a time delta in seconds, and returns
            a refreshed cookie string.
Takes a cookie string c and a time delta in seconds, and returns
            a refreshed cookie string.
Takes a cookie string c and a time delta in seconds and returns a refreshed cookie string .
def _refresh_cookie(self, c, delta):
        """
            Takes a cookie string c and a time delta in seconds, and returns
            a refreshed cookie string.
        """
        c = Cookie.SimpleCookie(str(c))
        for i in c.values():
            if "expires" in i:
                d = parsedate_tz(i["expires"])
                if d:
                    d = mktime_tz(d) + delta
                    i["expires"] = formatdate(d)
                else:
                    # This can happen when the expires tag is invalid.
                    # reddit.com sends a an expires tag like this: "Thu, 31 Dec
                    # 2037 23:59:59 GMT", which is valid RFC 1123, but not
                    # strictly correct according tot he cookie spec. Browsers
                    # appear to parse this tolerantly - maybe we should too.
                    # For now, we just ignore this.
                    del i["expires"]
        return c.output(header="").strip()
def _refresh_cookie ( self , c , delta ) : c = Cookie . SimpleCookie ( str ( c ) ) for i in c . values ( ) : if "expires" in i : d = parsedate_tz ( i [ "expires" ] ) if d : d = mktime_tz ( d ) + delta i [ "expires" ] = formatdate ( d ) else : # This can happen when the expires tag is invalid. # reddit.com sends a an expires tag like this: "Thu, 31 Dec # 2037 23:59:59 GMT", which is valid RFC 1123, but not # strictly correct according tot he cookie spec. Browsers # appear to parse this tolerantly - maybe we should too. # For now, we just ignore this. del i [ "expires" ] return c . output ( header = "" ) . strip ( )