also forget requests session in _forget()
This commit is contained in:
parent
535dd5e338
commit
024782eacc
1 changed files with 13 additions and 1 deletions
|
|
@ -2331,7 +2331,19 @@ class ClientSession(object):
|
|||
"""Forget session information, but do not close the session
|
||||
|
||||
This is intended to be used after a fork to prevent the subprocess
|
||||
from affecting the session accidentally."""
|
||||
from affecting the session accidentally.
|
||||
|
||||
Unfortunately the term session is overloaded. We forget:
|
||||
- the login session
|
||||
- the underlying python-requests session
|
||||
|
||||
But the ClientSession instance (i.e. self) persists
|
||||
"""
|
||||
|
||||
# forget our requests session
|
||||
self.new_session()
|
||||
|
||||
# forget our login session, if any
|
||||
if not self.logged_in:
|
||||
return
|
||||
self.setSession(None)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue