How can I set the cookies for subdomains? I follow...
# ory-selfhosting
b
How can I set the cookies for subdomains? I followed the config guide but doesn't seem to work. Still get the redirect loop above. Config;
Copy code
cookies:
  domain: <http://codebrewer.nl|codebrewer.nl>
  # path: /cookies
  path: /
  same_site: Lax

session:
  cookie:
    # Overrides cookies.domain for session cookies
    domain: <http://codebrewer.nl|codebrewer.nl>

    # Overrides cookies.path for session cookies
    path: /

    # Overrides cookies.samesite for session cookies
    same_site: Lax
    # same_site: Strict
p
Hi @brash-cartoon-33648 Not sure if this is related, but are you by chance using the express example from the docs? https://github.com/ory/docs/issues/767
Also if you are redirecting, is you app checking for an active session and then doing the redirect back to kratos?
It might be that the cookie is in fact set and kratos can see it but your app middleware isn't including it in the request.
b
Not specifically, just tried to setup the self serving UI from Ory and point it to my own Kratos
Just saw these logs:
Copy code
The anti-CSRF cookie was found but the CSRF token was not included in the HTTP request body (csrf_token) nor in the HTTP Header (X-CSRF-Token).
Copy code
The HTTP Cookie Header was set and a CSRF token was sent but they do not match. We recommend deleting all cookies for this domain and retrying the flow.
AFAIK I'm not doing anything too crazy here, so not sure why
Wait... It does work in a regular browser? I had been trying in an incognito window, and get the redirect loop there, but in a normal browser it does work
p
It should work in regular browser (incognito and normal)
csrf has a cookie and a token in the form
make sure both are incl
b
I'm not doing anything with those myself, that's all the self service UI, I assume it's handling them correctly. For whatever reason I only get the loop in Firefox incognito. Firefox normal, Chromium (normal & incognito) work fine