I'm hosting a django site locally. If baseQuery has relative path like that baseQuery: fetchBaseQuery({ baseUrl: '/api' }), then session id is sent inside headers automatically
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-CSRFToken': Cookies.get('csrftoken')
}
if front-end and back-end parts are hosted on different ports and the path in baseQuery is absolute
fetchBaseQuery({ baseUrl: 'http://localhost:8000/api' }) (while React is running on :3000)
then session id is not attached to requests and Django sends a new one with every response.
Is it normal behaviour and how can it be changed?