def delCookie(self, name, path='/', secure=False):
"""Delete a cookie at the browser.
To do so, one has to create and send to the browser a cookie with
parameters that will cause the browser to delete it.
"""
if name in self._cookies:
self._cookies[name].delete()
else:
cookie = Cookie(name, None)
if path:
cookie.setPath(path)
if secure:
cookie.setSecure(secure)
cookie.delete()
self.addCookie(cookie)
评论列表
文章目录