<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def access_cookie_valid(self, cookie, log_msg):
 """Check access cookie validity. Returns true if the access cookie is valid. The set of allowed access cookies is stored in self.access_cookies. Uses log_msg as prefix to info level log message of accetance or rejection. """

        if (cookie in self.access_cookies):
            age = int(time.time()) - self.access_cookies[cookie]
            if (age <= (self.access_cookie_lifetime + 1)):
                self.logger.info(log_msg + " " + cookie +
                                 " ACCEPTED COOKIE (%ds old)" % age)
                return True
            # Expired...
            self.logger.info(log_msg + " " + cookie +
                             " EXPIRED COOKIE (%ds old > %ds)" %
                             (age, self.access_cookie_lifetime))
            # Keep cookie for 2x lifetim in order to generate
            # helpful expired message
            if (age > (self.access_cookie_lifetime * 2)):
                del self.access_cookies[cookie]
            return False
        else:
            self.logger.info(log_msg + " " + cookie + " REJECTED COOKIE")
            return False