title: Parallelism of Puppeteer with Express Router Node JS. How to pass page between routes while maintaining concurrency
body: <pre><code>app.post('/api/auth/check', async (req, res) =&gt; {
  try {
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto(
      'https://www.google.com'
    );
    res.json({message: 'Success'})
  } catch (e) {
    console.log(e);
    res.status(500).json({ message: 'Error' });
  }});
  
  app.post('/api/auth/register', async (req, res) =&gt; {
    console.log('register');
    // Here i'm need to transfer the current user session (page and browser) and then perform actions on the same page.
    await page.waitForTimeout(1000);
    await browser.close();
  }});
  </code></pre>
  <p>Is it possible to somehow transfer page and browser from one route to another while maintaining puppeteer concurrency. If you set the variable globally, then the page and browser will be overwritten and multitasking will not work.</p>