Does anyone have a helper to decode cookie?
# talk-kratos
f
Does anyone have a helper to decode cookie?
f
can you please provide more context? Kratos session cookie?
f
yes. i have a cookie that was rejected by kratos, and i’d like to know why. basically i want to extract session id from it and check it manually.
i have all the secrets.
so i thought maybe there is already written standalone helper to do that.
f
I don’t think you can decode it
you can get session info by
sessions/whoami
f
it returns 401.
f
also db has error table
you can get info from there about flow errors
I usually use debug level logs
and it gives you extended information about the errors
f
cookie has encoded token that lives in the db/sessions/token. if you have cookie secret you should be able to decode it and extract token.
f
I can’t say much here (
f
I manage to decode it. Kratos uses gorilla/sessions storage