2

I'm doing a post request with axios

getSessionId() {
  const endpoint = 'http://localhost:8069/web/session/authenticate/'
  axios.post(endpoint, this.user).then((response) => {
    this.cookie = response.headers
    console.log(response.headers)
  })
}

I know the session id is en headers as a cookie, In the terminal of vs code i got this

  {                                                                                                                                                                                                       
     'content-type': 'application/json',
     'content-length': '1355',
     'access-control-allow-origin': '*',
     'access-control-allow-methods': 'POST',
     'set-cookie': [
         'session_id=b459a3fe46e0b32b039b6ebded4db308472abbb4;
         Expires=Thu, 04-Jun-2020 23:11:29 GMT; Max-Age=7776000;
         HttpOnly; Path=/'
      ],
     server: 'Werkzeug/0.16.0 Python/3.7.3',
     date: 'Fri, 06 Mar 2020 23:11:29 GMT'
}

But when I console log the response of the browser its give me

{
  content-length: "1355"
  content-type: "application/json"
}
Nicolas Rondon
  • 115
  • 1
  • 9

0 Answers0