Please enable / Bitte aktiviere JavaScript!
Veuillez activer / Por favor activa el Javascript![ ? ]
How to check that cookies came in response to a cross-domain request? - Q&A

How to check that cookies came in response to a cross-domain request?

0 like 0 dislike
Hi all.
Pile on the knee-authenticate from the frontend, right here is now time to implement jwt no.
The point is that I create a presentation authorization form through the FormData object and do a post request on the route for avtoriza with the setting withCredentials: true. All well and good, but the fact that the authorization was successful, I understand only because further requests to the API work as it should.
The question is, how can I track that cookies are established?
Now to change the state of the application me the idea to do an API query. Maybe there are other options?
asked by | 178 views

1 Answer

0 like 0 dislike
A million options.

If the cookie session/jwt not httpOnly, just looking at her. May wish to look at it before the query and after, and then compare.

Can do from the backend response to authorization "OK" / "not okay".

On the basis of further responses from the backend to understand, authorized or not.

The main thing — never a focus in the browser on claimi JWT like nbf, exp, because the client can be shot down time so that khendsheyk will have TLS, and all your schema updates will break. For example, will be off by 6 minutes when the validity of the token is 5 minutes.
answered by
Welcome to Bug-code Q&A, where you can ask questions and receive answers from other members of the community.

24.8k questions

46.2k answers


12.8k users

24,788 questions
46,220 answers
12,801 users