@@ -124,15 +124,26 @@ A message is defined by the following four-dictionary structure::
124
124
125
125
.. note ::
126
126
127
- A client session value, in message headers from a client, should be unique among
128
- all clients connected to a kernel and should be constant over the lifetime of
129
- the client. A kernel session value, in message headers from a kernel, should be
130
- generated on kernel startup or restart and should be constant for the lifetime
131
- of the kernel.
127
+ The ``session `` id in a message header identifies a unique entity with state,
128
+ such as a kernel process or client process.
129
+
130
+ A client session id, in message headers from a client, should be unique among
131
+ all clients connected to a kernel. When a client reconnects to a kernel, it
132
+ should use the same client session id in its message headers. When a client
133
+ restarts, it should generate a new client session id.
134
+
135
+ A kernel session id, in message headers from a kernel, should identify a
136
+ particular kernel process. If a kernel is restarted, the kernel session id
137
+ should be regenerated.
138
+
139
+ The session id in a message header can be used to identify the sending entity.
140
+ For example, if a client disconnects and reconnects to a kernel, and messages
141
+ from the kernel have a different kernel session id than prior to the disconnect,
142
+ the client should assume that the kernel was restarted.
132
143
133
144
.. versionchanged :: 5.0
134
145
135
- ``version `` key added to the header.
146
+ ``version `` key added to the header.
136
147
137
148
.. versionchanged :: 5.1
138
149
0 commit comments