human
I wrote the below code

    @implementer(ISession)
    class CookieSession(dict, ):
        '    Dictionary-like    session    object    '
        _cookie_name = cookie_name
        _cookie_max_age = (max_age if (max_age is None) else int(max_age))
        _cookie_path = path
        _cookie_domain = domain
        _cookie_secure = secure
        _cookie_httponly = httponly
        _cookie_on_exception = set_on_exception
        _timeout = (timeout if (timeout is None) else int(timeout))
        _reissue_time = (reissue_time if (reissue_time is None) else int(reissue_time))
        _dirty = False
        def __init__(self, request):
            self.request = request
            now = time.time()
            created = renewed = now
            new = True
            value = None
            state = {}
            cookieval = request.cookies.get(self._cookie_name)
            if (cookieval is not None):
                try:
                    value = serializer.loads(bytes_(cookieval))
                except ValueError:
                    value = None
            if (value is not None):
                try:
                    (rval, cval, sval) = value
                    renewed = float(rval)
                    created = float(cval)
                    state = sval
                    new = False
                except (TypeError, ValueError):
                    state = {}
            if (self._timeout is not None):
                if ((now - renewed) > self._timeout):
                    state = {}
            self.created = created
            self.accessed = renewed
            self.renewed = renewed
            self.new = new
            dict.__init__(self, state)
        def changed(self):
            if (not self._dirty):
                self._dirty = True
                def set_cookie_callback(request, response):
                    self._set_cookie(response)
                    self.request = None
                self.request.add_response_callback(set_cookie_callback)
        def invalidate(self):
           ...

What's a good function header?
assistant
#Here's a good function header.

def BaseCookieSessionFactory(serializer, cookie_name='session', max_age=None, path='/', domain=None, secure=False, httponly=False, timeout=1200, reissue_time=0, set_on_exception=True):