Thanks for the reply. I don’t want to change it to “/”. What should be the configuration so that it puts the path? I configured “xsrf_cookie_kwargs”: {“secure”: True, “httponly”: True, “expires_days”: 1}} in JH helm config (hub: extraConfig:). How can I set the path (“base_url”)? Since base_url is dynamic, what is the best way to set it?
You could try writing a wrapper script that runs jupyterhub-singleuser (or whatever command you’re using) with the custom arguments, and use that as your spawner command?
We put this in helm config
c.Spawner.args = [“–ServerApp.tornado_settings={"headers":{"Content-Security-Policy": "frame-ancestors urls…”}, "cookie_options": {"SameSite": "None","Secure": True }, "xsrf_cookie_kwargs": {"secure": True,"expires_days":0.5} }"]
You are saying move this logic to pre_spawn_start and set path for xsrf_cookie_kwargs using the env variable “JUPYTERHUB_SERVICE_PREFIX”. right?
We are already overriding pre_spawn_start method. So, I used pre_spawn_start method to form xsrf cookie path using string concat (‘/user/’ + user_id + ‘/’) and set this value in spawner arguments.
I am assuming the path pattern ‘/user/’ + user_id + ‘/’ will remain same. Please confirm.