Problem terminating an embedded bokeh server's session immediately after closing the browser's tab

Hello,

I’m embedding bokeh server in a flask web application, using the autoload_server method for different bokeh applications in that server.

I have different bokeh documents embedded in the same html page, and when an outer change occurs, i send different update functions to the add_next_tick_callback of the different documents.

I has multiple users, so in order to track which documents needs to be updated when an outer change occurs, i transfer a unique id as the session_id to the autoload_server method, and keep that id as a flask session variable.

The problem is that if a user closes the browser’s tab, the bokeh sessions isn’t deleted immediately, so if the user opens a new tab and enters the application again (without waiting a minute or so), autoload_server is called with a session id of an existing session, which causes problems.

I tried calling the request_expiration method on each session i create, but the session still isn’t deleted immediately by the bokeh server when the browser’s tab is closed. is there a way to terminate it immediately?

Thanks for your help.

You probably want these options:

  http://bokeh.pydata.org/en/latest/docs/user_guide/cli.html#session-expiration-options

Thanks,

Bryan

···

On Apr 30, 2017, at 03:25, sima <[email protected]> wrote:

Hello,

I'm embedding bokeh server in a flask web application, using the autoload_server method for different bokeh applications in that server.
I have different bokeh documents embedded in the same html page, and when an outer change occurs, i send different update functions to the add_next_tick_callback of the different documents.
I has multiple users, so in order to track which documents needs to be updated when an outer change occurs, i transfer a unique id as the session_id to the autoload_server method, and keep that id as a flask session variable.
The problem is that if a user closes the browser's tab, the bokeh sessions isn't deleted immediately, so if the user opens a new tab and enters the application again (without waiting a minute or so), autoload_server is called with a session id of an existing session, which causes problems.
I tried calling the request_expiration method on each session i create, but the session still isn't deleted immediately by the bokeh server when the browser's tab is closed. is there a way to terminate it immediately?

Thanks for your help.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/839044c8-811b-4c7b-b64c-e3bfbc9e4f15%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.