Successfully added
JavaScript
by Patrik
Make Axios send cookies
Make Axios send cookies in its requests automatically.
You can use the withCredentials
property.
axios.get(BASE_URL + '/todos', { withCredentials: true });
Also it is possible to force credentials to every Axios requests
axios.defaults.withCredentials = true
Or using credentials for some of the Axios requests as the following code
const instance = axios.create({
withCredentials: true,
baseURL: BASE_URL
})
instance.get('/todos')
Referenced in:
Comments(7)
DesmondPailm
6/14/2024 2:19:51 PMAndyPailm
5/18/2024 10:13:32 AMJamesNak
12/20/2023 1:59:40 PMAaronfut
12/19/2023 12:43:01 PMAaronfut
12/19/2023 9:14:20 AMPerryfooms
12/18/2023 5:03:03 PMMikhailRS
11/30/2023 5:58:00 AM