Do you create your own JWT?
If so, you should consider using an asymmetric encryption based signature algorithm, such as “RS256” or “RS512,” so you can verify claims in your client application without sharing a secret secret.
Do you really need to pass the JWT into a cookie?
It might be safer to just put a random identifier in your cookie that references the JWT access token and do the magic of deleting links on the server that serves your web application.
source share