File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
IPython/frontend/html/notebook Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,12 @@ def _inject_cookie_message(self, msg):
506
506
# Cookie constructor doesn't accept unicode strings
507
507
# under Python 2.x for some reason
508
508
msg = msg .encode ('utf8' , 'replace' )
509
+ try :
510
+ bsession , msg = msg .split (':' , 1 )
511
+ self .session .session = bsession .decode ('ascii' )
512
+ except Exception :
513
+ logging .error ("No bsession!" , exc_info = True )
514
+ pass
509
515
try :
510
516
self .request ._cookies = Cookie .SimpleCookie (msg )
511
517
except :
@@ -528,7 +534,7 @@ def max_msg_size(self):
528
534
def create_stream (self ):
529
535
km = self .kernel_manager
530
536
meth = getattr (km , 'connect_%s' % self .channel )
531
- self .zmq_stream = meth (self .kernel_id )
537
+ self .zmq_stream = meth (self .kernel_id , identity = self . session . bsession )
532
538
533
539
def initialize (self , * args , ** kwargs ):
534
540
self .zmq_stream = None
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ var IPython = (function (IPython) {
129
129
this . shell_channel = new this . WebSocket ( ws_url + "/shell" ) ;
130
130
this . iopub_channel = new this . WebSocket ( ws_url + "/iopub" ) ;
131
131
send_cookie = function ( ) {
132
- this . send ( document . cookie ) ;
132
+ this . send ( that . session_id + ':' + document . cookie ) ;
133
133
} ;
134
134
var already_called_onclose = false ; // only alert once
135
135
var ws_closed_early = function ( evt ) {
You can’t perform that action at this time.
0 commit comments