This seemed to work for me: first you need to call sanctum but before calling sanctum add this line on your axios file axios.defaults.withCredentials = true; then call sanctum eg // axios .get( "http://localhost:9000/sanctum/csrf-cookie" ) .then((res) => toast.success("sanctum loaded successfully")); then now you can create a custom object export const axiosInstance = axios.create({ baseURL: "http://localhost:9000/api/", timeout: 100000, withXSRFToken: true, timeoutErrorMessage: "Server timeout", }); then use the instance to make other api calls eg register