title: res.redirect works on Postman but don't work in chrome
body: <p>The goal of the project is to have user registration. Once the submit button is pressed, a post request containing the email and password is fired. If the email is found, a res.redirect is send to the client to redirect to the failure page.</p>
  
  <p>Under the network section in chrome console, we can find the chrome receive the redirect response. Although the redirect works in postman, it does not work in chrome. Why?</p>
  
  <p><a href="https://i.stack.imgur.com/WoQSe.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>The server side code is the following:</p>
  
  <pre><code>app.post('/Register',async (req,res)=&gt;{
      const hashing_password = async (email, password)=&gt;{
          return new Promise((resolve,reject)=&gt;{
              bcrypt.hash(password, 10, (err,hash)=&gt;{
                  if (err){
                      console.log('Error in hashing password')
                      reject(false)
                  }
                  let UserInfo = {
                      email: email,
                      hashed_password: hash,
                  }
                  console.log('hashing password sucessfully')
                  resolve(UserInfo)
              })
          })
      }
  
      const IsEmailUnique = async (UserInfo) =&gt;{
          return new Promise((resolve, reject)=&gt;{
              let FindEmailExistQuery = `SELECT * FROM users WHERE email LIKE \'${UserInfo.email}\';`
              pool.query(FindEmailExistQuery, (error, results)=&gt;{
                  if(error){
                      console.log(`Error during IsEmailUnique, and the error is ${IsEmailUnique}`)
                      reject(false)
                  } 
                  if(results.length !== 0){
                      console.log(`The email already exist`)
                      reject(false)
                  }
                  resolve(UserInfo)
              })
          })
      }
  
      const AddUserToDatabase = async (UserInfo)=&gt;{
          return new Promise((resolve, reject)=&gt;{
              let AddUserToDatabaseQuery = `INSERT INTO users (email, hashed_password, register_date) values (\'${UserInfo.email}\', \'${UserInfo.hashed_password}\', now());`
              pool.query(AddUserToDatabaseQuery, (error, results)=&gt;{
                  if(error){
                      console.log(`Error during AddUserToDatabase, and the error is ${error}`)
                      reject(false)
                  }
                  console.log(`Add user sucessfully`)
                  resolve(true)
              })
          })
      }
  
      const RegistrationResult = await hashing_password(req.body.email, req.body.password)
          .then((UserInfo)=&gt;{
              return IsEmailUnique(UserInfo)})
          .then((UserInfo)=&gt;{
              return AddUserToDatabase(UserInfo)})
          .catch((error)=&gt;{
              return error})
  
      console.log(RegistrationResult)
  
      if(!RegistrationResult){
          res.redirect('https://lihkg.com/thread/2037550/page/1')
      }else{
          res.redirect('https://forum.hkgolden.com/channel/BW')
      }
  })
  </code></pre>
  
  <p>The client side of code is the followng:</p>
  
  <pre><code>import React, { useState } from 'react'
  import './App.css'
  import Elephant from './StockPhotos/random.jpg'
  import DangerText from './DangerText/DangerText'
  
  export default function Register() {
  
      const [AgreeTerms, setAgreeTerms] = useState(false)
      const [EmailDangerText, setEmailDangerText] = useState('none')
      const [PasswordDangerText, setPasswordDangerText] = useState('none')
      const [passwordReenteredDangerText, setPasswordReenteredDangerText] = useState('none')
      const [AgreeTermsDangerText, setAgreeTermsDangerText] = useState('none')
  
      let RegisterEvent = async(event) =&gt;{
          //event.preventDefault()
          let EmailRegex = /[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g
          let PasswordRegex = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,}$/gm
          //- at least 8 characters
          //- must contain at least 1 uppercase letter, 1 lowercase letter, and 1 number
          //- Can contain special characters
  
          let RegisterData = {
              email: document.getElementById('email').value, 
              password: document.getElementById('password').value, 
          }
  
          if(AgreeTerms === false){
              setAgreeTermsDangerText('You must agree with the terms and conditions to register.')
              console.log('Agree terms is false')
              return false;
          }
  
          if(!EmailRegex.test(RegisterData.email)){
              //event.preventDefault()
              setEmailDangerText('You must enter a correct email address')
              console.log('Email format is incorrect')
              event.preventDefault()
              return false;
          }
  
          if(!PasswordRegex.test(RegisterData.password)){
              setPasswordDangerText('The password must satisfy the pattern')
              console.log('password format is incorrect')
              return false;
          }
  
          if(RegisterData.password != document.getElementById('passwordReentered').value){
              setPasswordReenteredDangerText('The password must match')
              console.log('password dont match')
              return false;
          }
  
          //let RegistrationResult = await fetch('/Register',{
              //method: 'POST',
              //headers: {
                  //'Content-Type': 'application/json'
              //},
              //body: JSON.stringify(RegisterData)
          //}).then((res)=&gt;{
              //console.log(res)
              //return true
          //}).catch((error)=&gt;{
              //console.log(JSON.stringify(error))
              //return false
          //})
  
          fetch('/Register',{
              method: 'POST',
              headers: {
                  'Content-Type': 'application/json'
              },
              body: JSON.stringify(RegisterData)
          })
  
          //console.log(result)
      }
  
      return (
          &lt;div className='d-flex flex-column vh-100 p-5 my-auto align-items-center justify-content-center'&gt;
              &lt;img className='rounded-lg' style={{
                  height: '20vmin',
                  width: '20vmin',
              }} src={Elephant}/&gt;
              &lt;p class='font-weight-light text-center vh-10 py-3' style={{
                  maxHeight: '10vh',
                  marginBottom: 0
              }}&gt;Register here&lt;/p&gt;
  
              &lt;form target="_blank"&gt;
                  &lt;div className='form-group'&gt;
                      &lt;input type="email" className='form-control' placeholder='Email address' id='email' required autoFocus/&gt;
                      &lt;DangerText DangerText={EmailDangerText}/&gt;
                  &lt;/div&gt;
                  &lt;div className='form-group'&gt;
                      &lt;input type="password" className='form-control' placeholder='Password' id='password' required autoFocus/&gt;
                      &lt;DangerText DangerText={PasswordDangerText}/&gt;
                      &lt;small id="emailHelp" class="form-text text-muted"&gt;The password must match the following pattern:
                                                                      &lt;br/&gt;- at least 8 characters
                                                                      &lt;br/&gt;- must contain at least 1 uppercase letter, 1 lowercase letter, and 1 number
                                                                      &lt;br/&gt;- Can contain special characters
                      &lt;/small&gt;
                  &lt;/div&gt;
                  &lt;div className='form-group'&gt;
                      &lt;input type="password" className='form-control' placeholder='Reenter your password' id='passwordReentered' required autoFocus/&gt;
                      &lt;DangerText DangerText={passwordReenteredDangerText}/&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group form-check text-center"&gt;
                      &lt;input type="checkbox" class="form-check-input" onClick={()=&gt;{setAgreeTerms(!AgreeTerms)}} autoFocus required/&gt;
                      &lt;label class="form-check-label" for="AgreeTerms"&gt;I agree with the terms and conditions&lt;/label&gt;
                      &lt;DangerText DangerText={AgreeTermsDangerText}/&gt;
                  &lt;/div&gt;
                  &lt;button type="submit" className="btn btn-primary d-flex mx-auto" onClick={(event)=&gt;{RegisterEvent(event)}}&gt;Register&lt;/button&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      )
  }
  </code></pre>
  
  <p>The github repository is the following:
  <a href="https://github.com/1564851/Qaudcopter-delivery-website-by-MySQL-and-React" rel="nofollow noreferrer">https://github.com/1564851/Qaudcopter-delivery-website-by-MySQL-and-React</a></p>