subdomain setup react -- 2

Closed Posted 1 year ago Paid on delivery
Closed Paid on delivery

im creating mern app which requires dynamic unlimited subdomains like [login to view URL] for this if write any thing before localhost it gives me error invalid host header.

To achieve this, I have added the line

DANGEROUSLY_DISABLE_HOST_CHECK=true

in my .env file. which is not a good idea.

When a user logs in at localhost:3000, cookies are created and the user is authenticated. If the user is registered with a specific company, they should be redirected to [login to view URL] while remaining logged in. However, upon redirecting to the subdomain, all cookies that were created on localhost are lost and the user is redirected to the login page again. I expected the cookies to persist on the subdomain and enable the user to remain logged in. Can someone please assist me with this issue?

React.js MERN Stack Node.js Express JS

Project ID: #36274284

About the project

6 proposals Remote project Active 1 year ago

6 freelancers are bidding on average $136 for this job

john1101

The reason why the cookies are lost upon redirecting to the subdomain is because cookies are domain-specific, meaning they are only accessible on the domain and its subdomains that created them. Since your app is runni More

$30 USD in 2 days
(1 Review)
1.7
softtrain

Hi Greetings! We are team of software developers. We have big team of around 1500 software developers all over the world associated with us. We have developers working on almost all the technologies. We will assign yo More

$250 USD in 7 days
(0 Reviews)
0.0
pannnov

hello Thank for your job posting I just read your job description and I think it's a great fit for your project. Please look forward to the best beautiful results. I've done similar things in the past With my rich expe More

$140 USD in 7 days
(0 Reviews)
0.0
ronicksamuel

Hello, I have encountered similar problems on past projects and I'm happy to work with you on this one. To solve this issue, we need to modify the domain and path of the cookie so that it can be accessed by pages on t More

$140 USD in 7 days
(0 Reviews)
0.0
nikkisingh1311

Hii there. I have worked on mern as my full time opportunities. As i am the professional one. I will complete your task in your budgets and on time. Trust me and moves one step . You will feel so excited. Thank you.

$35 USD in 7 days
(0 Reviews)
0.0