Amal Vijayan
Amal Vijayan

Reputation: 739

Setting JupyterHub SameSite Cookie Attribute

I have jupyterhub(TLJH) running on my AWS. It is served on my site using an iframe. Since the latest chrome update, the "SameSite" cookie attribute is causing the following issue. The below image shows what I see in the Iframe

enter image description here

Given below is the warning I get in my console:

A cookie associated with a cross-site resource at http://www._____.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

When I disable the SameSite attribute in chrome://flags/, the iframe loads perfect.

I understand that I need to edit my cookie settings to add {SameSite=None; Secure} somewhere in jupyterhub, but I don't know where.

Upvotes: 0

Views: 1783

Answers (3)

songhao chang
songhao chang

Reputation: 1

You can use jupyterhub proxy give your server a domain name like "http:***.mydomain.com" .But this must be subdomain of your site("http://www._____.com/")

Upvotes: 0

Amal Vijayan
Amal Vijayan

Reputation: 739

I could make it work only by making my server map to a subdomain. For example, say the main website which has the Iframe embed is www.mydomain.com, I had to map my Jupyter server to "subdomain.mydomain.com" to make it work.

It is obvious that the above approach was possible because the page I was trying to embed was owned by me. Hoping for an answer for the other scenario!

Upvotes: 0

rowan_m
rowan_m

Reputation: 3050

It looks to me as if you may be able to use the cookie_options setting to add SameSite=None; Secure to the cookies, but I am not 100% sure.

I've raised https://github.com/jupyterhub/jupyterhub/issues/3117 to ask the team to validate.

Upvotes: 0

Related Questions