#make request for cookies inside createSessionFunction

1 messages · Page 1 of 1 (latest)

mild dome
#

Dear all, I am trying to use createSessionFunction to create a session and set some basic cookies from a response. The problem is how can I make a request to an endpoint to get a cookies inside createSessionFunction ?

My basic code is this and am wondering what is the best way to get cookies without breaking the flow of the crawler.

` createSessionFunction: async(sessionPool,options) => {

    const session1 = await sessionPool.getSession();
    const proxyurl = await proxyConfigurationEU.newUrl(session1.id);
    // Get cookies 


   session1.setCookiesFromResponse(response);
   

   return session1

}`
polar beacon