Official way to setup httponly cookies between Strapi v4 and a React App

System Information
  • Strapi Version: 4.9
  • Operating System: Ubuntu 18.04.6 LTS
  • Database: mysql 8.0.27
  • Node Version: 16.19.0
  • NPM Version: 8.19.3
  • Yarn Version:

What is the official way to setup httponly cookies between Strapi v4 and a React app, I can’t find any good documentation that show how exactly to do this in v4. I want to store a jwt and some user details in a httponly cookie while using only React and Strapi v4. I have found some guides for v3 that say you need to extend user-permissions to be able to do this, is that still the case for v4? Found this thread that’s seems like it should work, is this the official way?

did you find any solution? i tried the code from the link u added but not working, the middleware causing something weird when you you log in in as admin content manager, it’s never go to homepage, it’s retrieves you always to log in again. Idk why but in simple words that’s not works.

I’m wasting a lot of time trying to extends users-permissions auth.js to configure there a cookies setup customizing the strapi core but i can’t!!! i cant believe no one is documenting this.
i saw this video https://www.youtube.com/watch?v=OESLVW_lAQ8 but its strapi v3!! tried in v4 but still can’t find the way, did you find any solution?