HttpOnly Cookie
Does httpOnly cookie work if my FE and BE are on the same domain?
Because I tried hosting my BE in
example.com
and FE in abc.com
, In this case it doesn't work
But it happens to work if my FE: example.com
BE: example.com/api
|| api.example.com
2 Replies
yes, it your cookie is httpOnly, just set it on the backend domain and it will work
I think if the domains are entirely different, it will count as a third party cookie and most browsers block those
Thank you for you response @ronanru
A follow up question, is it possible to prevent the browser from blocking it?