Repository: bokeh/bokeh

Issue:
[BUG] 'bokeh.server.django' ignores &bokeh-session-id url parameter
#### ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh 2.0.0
django 3.0.4
channels 2.4.0
python 3.6.8

#### Description of expected behavior and the observed behavior

I was expecting `&bokeh-session-id=` GET param to work when embedding bokeh into django using the bokeh-provided `bokeh.server.django` django-app, but it ignores it. My project depends on this GET param in order to allow multiple browser windows connected to the same bokeh document (using [golden layout](https://github.com/golden-layout/golden-layout)) for user pop-in/out of dockable bokeh compenents. So I think if this is not considered as a [BUG] then maybe it should then be considered as a worthwhile [FEATURE].

#### Complete, minimal, self-contained example code that reproduces the issue

Simply run https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/django_embed/ and experiment with `&bokeh-session-id=` in the URL.

#### Stack traceback and/or browser JavaScript console output

n/a

#### Screenshots or screencasts of the bug in action

n/a
[BUG] 'bokeh.server.django' ignores &bokeh-session-id url parameter
#### ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

bokeh 2.0.0
django 3.0.4
channels 2.4.0
python 3.6.8

#### Description of expected behavior and the observed behavior

I was expecting `&bokeh-session-id=` GET param to work when embedding bokeh into django using the bokeh-provided `bokeh.server.django` django-app, but it ignores it. My project depends on this GET param in order to allow multiple browser windows connected to the same bokeh document (using [golden layout](https://github.com/golden-layout/golden-layout)) for user pop-in/out of dockable bokeh compenents. So I think if this is not considered as a [BUG] then maybe it should then be considered as a worthwhile [FEATURE].

#### Complete, minimal, self-contained example code that reproduces the issue

Simply run https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/django_embed/ and experiment with `&bokeh-session-id=` in the URL.

#### Stack traceback and/or browser JavaScript console output

n/a

#### Screenshots or screencasts of the bug in action

n/a


Discussion:

Resolving patch:
diff --git a/bokeh/server/django/consumers.py b/bokeh/server/django/consumers.py
--- a/bokeh/server/django/consumers.py
+++ b/bokeh/server/django/consumers.py
@@ -108,7 +108,8 @@ def __init__(self, scope: Dict[str, Any]) -> None:
             self.application_context._loop = IOLoop.current()
 
     async def _get_session(self) -> ServerSession:
-        session_id = generate_session_id(secret_key=None, signed=False)
+        session_id = self.arguments.get('bokeh-session-id',
+                                        generate_session_id(secret_key=None, signed=False))
         payload = {'headers': {k.decode('utf-8'): v.decode('utf-8')
                                for k, v in self.request.headers},
                    'cookies': dict(self.request.cookies)}


Test patch: