How to properly use httpOnly cookie?

Hello,

I am in the process of learning cookies and I have a problem.
I made a login server action to create a jwt token and store it as a httpOnly cookie because I read that it is more secure. Then, I also have another server action to retrieve the token via post (client api action) and decode the token.

The problem is that the cookie manager seems to not be able to read a httpOnly cookie. So how to use it?

so it can only be accessed from $_COOKIE

A httpOnly cookie can only be accessed from the server and not from the client.