

def set_cookie(self, name, value, domain=None, expires=None, path='/', expires_days=None, **kwargs):
    'Sets the given cookie name/value with the given options.\n\n        Additional keyword arguments are set on the Cookie.Morsel\n        directly.\n        See http://docs.python.org/library/cookie.html#morsel-objects\n        for available attributes.\n        '
    name = escape.native_str(name)
    value = escape.native_str(value)
    if re.search('[\\x00-\\x20]', (name + value)):
        raise ValueError(('Invalid cookie %r: %r' % (name, value)))
    if (not hasattr(self, '_new_cookie')):
        self._new_cookie = Cookie.SimpleCookie()
    if (name in self._new_cookie):
        del self._new_cookie[name]
    self._new_cookie[name] = value
    morsel = self._new_cookie[name]
    if domain:
        morsel['domain'] = domain
    if ((expires_days is not None) and (not expires)):
        expires = (datetime.datetime.utcnow() + datetime.timedelta(days=expires_days))
    if expires:
        morsel['expires'] = httputil.format_timestamp(expires)
    if path:
        morsel['path'] = path
    for (k, v) in path.items():
        if (k == 'max_age'):
            k = 'max-age'
        morsel[k] = v

dataset/ETHPy150Open RobotWebTools/rosbridge_suite/rosbridge_server/src/tornado/web.py RequestHandler.set_cookie/VarMisuse@236/383 `kwargs`->`path`