Hi, We are extending our server sessions using Kr...
# ory-selfhosting
b
Hi, We are extending our server sessions using Kraos Admin API when we validate incoming requests. However, this alone is not useful if the cookie expiry is not extended. What is the right way to synchronize the expiration date/time on the cookie with that of the session's expiration date/time?
s
I had exactly this problem. It turns out that the whoami request FrontendAPI.ToSession() returns a cookie in its reply when the previous cookie is expiring so on every call to ToSession in our middleware we check for a returned session cookie (ory_kratos_session) and set that on the reply to the javascript. I hope I have explained this well enough, I can give more detail / code snippets if needed.
IMHO its one of the corners of the ORY apis that is not well documented.