Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

327
Views
How to add cookies from one domain to other in the domain folder

Recently I deployed my Nest JS backend on domain: name.herokuapp.com and Next JS frontend on domain: name.vercel.app. In both cases names are equal. Backend set cookies successfully, but in different cookie folder - name.herokuapp.com. But I want that this cookies are located in folder name.vercel.app, so i can attach them in my getServerSideProps function. My backend code:

res.cookie('accessToken', at, {
        sameSite: 'none',
        secure: true,
        httpOnly: false,
        path: '/',
});

Result, what i got:

I want, that all cookies are located in name.vercel.app folder.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So, there is an answer. This is impossible. That's it. But you can solve this issue this way:

  1. Deploy you front on domain.com.
  2. Deploy your backend on any other domain2.com.
  3. Connect your domain2.com to api.domain.com or other subdomain using CNAME for example.
  4. Send cookies to .(<- important)domain.com. Before I used Vercel to deploy my front and Heroku to deploy my backend. Now I am using render.com(thank you😇) for back.

Hope, this helps)

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!