ukwa / ukwa-services

Deployment configuration for all UKWA services stacks.
Apache License 2.0
5 stars 5 forks source link

Issues with cookies and sessions on W3ACT #45

Closed anjackson closed 2 years ago

anjackson commented 3 years ago

This is to note any outcomes from https://github.com/ukwa/w3act/issues/662

Cookie “PLAY_SESSION” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
anjackson commented 3 years ago

It seems not to be the specific JSESSIONID cookie, but perhaps that there are so many cookies from archived websites the browser is discarding the one we care about.

anjackson commented 3 years ago

I've made DEV copy the auth cookie into every response, as I'm assuming this will mean it is considered 'fresh' and should not be dropped. I've asked Carlos to check if it helps.

Specifically:

add_header 'Set-Cookie' 'PLAY_SESSION=$cookie_PLAY_SESSION; Domain=$http_x_forwarded_host; Path=/act; SameSite=Strict; HttpOnly; Secure; Priority=High';
anjackson commented 3 years ago

As per https://github.com/ukwa/w3act/issues/662#issuecomment-940948374 the add_header hack seems to work.

anjackson commented 3 years ago

Wayback * forwarding appears to work fine on DEV.

anjackson commented 3 years ago

Amusingly, because the settings of the from-W3ACT and copied cookies are slightly different, it's currently not possible to log out of W3ACT! 👎 The app sets

Set-Cookie
    PLAY_SESSION=; Max-Age=-86397; Expires=Mon, 11 Oct 2021 12:59:55 GMT; Path=/act; HTTPOnly

This does not overwrite the cookie that is copied for pywb.

anjackson commented 3 years ago

Original cookie...

2021-10-12-original-cookie

Copied cookie...

2021-10-12-copied-cookie

anjackson commented 3 years ago

Removing the Domain=$host part (i.e. the bit with the leading dot . in the copied cookie) seems to restore the expected behaviour.

anjackson commented 2 years ago

Deferring SameSite to next quarter. Calling this done but leaving original ticket open until W3ACT is deployer.