Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/user/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@ you're making several requests to the same host, the underlying TCP
connection will be reused, which can result in a significant performance
increase (see `HTTP persistent connection`_).

.. warning::

``requests.Session`` objects are **not safe to share across multiple processes**.
In a multi-process environment (for example, when using ``multiprocessing`` or
task queues like Celery), create a **separate Session in each process**.

Sharing a Session across processes may lead to unexpected behavior due to
connection pooling being inherited after a process fork.


A Session object has all the methods of the main Requests API.

Let's persist some cookies across requests::
Expand Down