'Cookies disappear after reload the page

response.set_cookie(key=SIMPLE_JWT.get('REFRESH_AUTH_COOKIE'), value=response.data.get('refresh'),
            expires=datetime.now()+SIMPLE_JWT.get('REFRESH_TOKEN_LIFETIME'), samesite='None',
            secure=SIMPLE_JWT.get('AUTH_COOKIE_SECURE'), httponly=SIMPLE_JWT.get('AUTH_COOKIE_HTTP_ONLY'))

I'am using Django Rest Framework to set the JWT Refresh cookie, until this point everything is ok, but when I reload the page the cookie just disappear so I can't retrieve the value any more by JS, but when I send a new request the cookie appears in the Django log. So, I don't know what is happening because the cookie is set in the browser, but in a way that I can't retrieve



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source