Hi everyone! I’m evaluating Ory Cloud for some of ...
# ory-network
g
Hi everyone! I’m evaluating Ory Cloud for some of our projects. I just noticed that logout flow does not remove Ory cookies. Is that expected?
h
Hi Ilya, that is not expected! What Ory cookies linger around? 🙂
g
playing around with the Vue example logout actually sets cookie
h
What’s the cookie’s name?
I see, that is expected, this instruction tells the browser to delete the cookie, hence it expires in 1970 🙂
g
here’s a consequent request or are these different cookies?
h
These are different cookies,
_auth_session
,
userid
is not from Ory.
csrf_token
is from Ory, but it is a different type of cookie (a security cookie).
__cflb
is from cloudflare
g
for context: I’m a bit concerned about the latencies that I see when validating sessions on the backend, so I thought if I cache them until expiration and rely on the frontend not having the Ory cookie that would resolve the issue?
These are different cookies,
_auth_session
,
userid
is not from Ory
ah, ok maybe something from Node that comes with the example 🤔 thanks
h
Since you are on localhost, it can also come from another application
g
hm, I guess you’re right!
h
I understand the latency concern, we are working towards a solution here to answer “is the user still authenticated” within ~30ms for P95 of requests and are aiming to improve even further. /cc @famous-art-85498 @fast-lunch-54279
It’s on the roadmap for the next month if I am not mistaken, but it can take a bit longer due to the complexity
g
I see, thank you In general, do you think that it’s a good approach to cache session validation until expiration (or some time) and rely on the client not having the cookie (went through logout flow and the cookie was removed)?
h
That is for sure an option you can consider. It depends on your security model, but in applications that have less security requirements it is often acceptable. Platforms like Auth0 actually do not offer it any other way (the tokens remain active until they expire), so it seems to be accepted industry practice. In general though, I would recommend a “stale-while-revalidate” strategy where you use the value from the cache but validate it in the background and update the cache once the result is here. https://web.dev/stale-while-revalidate/
g
I’ll consider this, thank you!
h
Pleasure!