'Write to cookie if serializable and dirty (generally new).
:param dict cookie_attrs: additional cookie attrs.'

def save(self, **cookie_attrs):

    if (self.serializable and self.dirty):
        expires = (datetime.utcnow() + EXPIRES_RELATIVE)
        for (name, value) in ((LOID_COOKIE, self.loid), (LOID_CREATED_COOKIE, isodate(self.created))):
            d = cookie_attrs.copy()
            d.setdefault('expires', expires)
            self.context.cookies.add(name, value, **d)
