axios.post('http://drupal-site.local/user/login?_format=json',{
"name": username,
"pass": password
}).then(resp..................})
Here I'm calling Drupal login API in react(http://localhost:3000). Cookies are not set in headers. If I'm calling in postman same API then cookies are setting in headers.
I tried with {withCredentials: true}
and include: credentials but no use.
axios.post('http://drupal-site.local/user/login?_format=json', {
"name": username,
"pass": password
}, {
withCredentials: true, // or
credentials: include
})
.then(() => {})