Cookies not sending to backend in client componnent
Unanswered
Spectacled bear posted this in #help-forum
Spectacled bearOP
Im using redux rtk query for dealing with apis, I've set the token in cookies, what i want is to send this cookie to every server request i made, but it is not happening? Any idea ?
19 Replies
Spectacled bearOP
cookies should set automatically to every api request, but not happenng in this case
Spectacled bearOP
anyone?
@Spectacled bear cookies should set automatically to every api request, but not happenng in this case
you need to add
credentials: include in requestSpectacled bearOP
thanks @@ts-ignore
Spectacled bearOP
@@ts-ignore im using redux rtk query with nextjs. I want to send cookies to backend which is hosted on diffrent domain, on local it is working fine as both are on local host but on prod it is not working
I've explicitly passed mode as cors fetchBaseQuery still it is not working. Any idea?
I've explicitly passed mode as cors fetchBaseQuery still it is not working. Any idea?
Spectacled bearOP
@Ray do you have any idea?
Gray Kingbird
Search the web for cross domain cookies.
@Spectacled bear <@743561772069421169> do you have any idea?
how did you set the cookie?
@Ray how did you set the cookie?
Spectacled bearOP
from server
@Spectacled bear from server
backend?
@Spectacled bear from server
check the cookies on your browser and make sure the domain of the cookies is your backend
@Ray check the cookies on your browser and make sure the domain of the cookies is your backend
Spectacled bearOP
the thing is on local it is working fine, on remote it is not sending the cookies back
@Spectacled bear the thing is on local it is working fine, on remote it is not sending the cookies back
what do you mean on local and on remote?
Spectacled bearOP
means when im running client and server on my local machine cookies are getting sent to server
Spectacled bearOP
both are hosted on different domains
@Ray so what is the problem now?
Spectacled bearOP
.
@Spectacled bear means when im running client and server on my local machine cookies are getting sent to server
you said cookie are getting sent to server? so what is the issue now?