W
W
wlms2019-03-15 13:29:25
Node.js
wlms, 2019-03-15 13:29:25

vuejs authorization?

After authentication, I have a session cookie set. Should I then send it to the server in the Authorization header with each request, or what?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Okhotnikov, 2019-03-15
@tsepen

Yes

M
Medin K, 2019-03-15
@medin84

Depending on what the backend dictates, if necessary in the Authorization header, then yes.
Cookies and so with each request are "usually" sent along with the request to the server.
If you are using fetch, then you need to specify additionally what cookies should be sent
https://developer.mozilla.org/ru/docs/Web/API/Fetc...

fetch('https://example.com', {
  credentials: 'include'  
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question