Skip to content

Instantly share code, notes, and snippets.

View notiles's full-sized avatar

Guillaume Rancurel notiles

  • Proximity Paris
  • Paris, France
  • X @notiles
View GitHub Profile
@nzvtrk
nzvtrk / axiosInterceptor.js
Last active April 14, 2025 13:50
Axios create/recreate cookie session in node.js enviroment
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration.
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js
* Also, this example supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });