Ok, so the solution of using F5 tech provided functionality is actually not working. Leaving the browser tab open on Jupyterlab will never trigger a timeout as the JavaScript application continuously issues http requests, so it is always seen as active as long as the browser tab has focus.
The only solution I see currently is to implement some kind of plugin which checks for inactivity on the client side, and automaticaly redirects to logout page if user doesn’t touch its mouse or keyboard during a given period.
Does that sounds feasible ?
Cc @minrk who already gave precise answers to questions like this one.
@guillaumeeb we have the same challenge (enterprise context, strict security requirements to session TTL, etc). At current stage of research looks like a custom extension is the only way to implement proper session management (without forking/hacking the lab code itself).
although i have immediate feature request as we usually deal with strict security requirements which introduce also max session TTL (regardless idle time). i can imagine a configurable session’s endpoint to call periodically and validate 401/403 status code…
Only just found this thread and it is super cool to see how short the code is!
Some nitpicking on language: JupyterLab and classic Jupyter notebook are two different frontends that can be used with JupyterHub. This means there is no “classic JupyterHub”, only “classic Jupyter notebook”.
It would be cool to make a official package that is simultaneously a classic notebook and JupyterLab extension to get this functionality on both types of frontend.
I’m thinking we should make a variation of this extension for mybinder.org that shows users the (approximate) time remaining before their session will end (if they are getting close to the end). WDYT @manics?
If you’re publishing a JupyterHub extension what would be ideal from the mybinder.org point of view is if it could be customised if necessary, or perhaps extended i.e. use your extension as a library. I’ve no idea how to do that with JupyterLab though.
Anyway, if the mecanism could some way be put on Jupyterhub side, this would be great, but I did not found any simple solution.
The problem with the Jupyterlab or classic notebook extension is that if you propose a platform where users can customize and run their own Jupyterlab, you cannot easily ensure that the extension is installed…
So just wanted to ask if someone had an idea on how to put such a verification on Jupyterhub side?
You can implement a form of “shutdown after inactivity” on the server side using the approach mentioned in this post User automatic logout on inactivity. We use this for mybinder.org. However this is a config in the jupyter notebook server, not the JupyterHub server.
The idea is that a kernel can detect that it is “inactive” and shut itself down. This works even if a JupyterLab frontend is connected to the kernel. Once the kernel has shutdown the network traffic stops which allows JupyterHubs culler to detect that there is no more activity and then culls the user/session.
Hi @jagdeesh, we are not planning on working on the release of an npm package for this… But you can easily install it with a git clone and jupyter labextension install.