You can use the Auth0 user ID (present in the token as the sub claim).
There are different approaches here, but I suggest storing this info in your DB if it is linked to non-auth data like user content/posts. It’s possible to use the Auth0 management API to retrieve a list of users, but you will need to handle rate limits and do it via rest API and will need to reach out to your DB to get the user’s post anyway. It may be simpler to just use your existing DB.
Auth0’s SDKs usually handle the cookies for you. None of our quickstarts require any manual cookie settings or storage.