ex: if at the home page or other page and then go to the video page, the API return from req.session of nodejs server is correct, but if at the current page I press F5(reload the page, get API before render) the result is null(session is null). So, please help me resolve this problem. Thank you.
Asked
Active
Viewed 415 times
1 Answers
1
The Application Architecture is most required here to know, How you are using Node and Angular.
But as you mentioned API is not responding in a proper manner. So the logic you will have to check at Auth Guard.
If you want to work with Reload, Then the session token must be store at the Browser Memory.
API call required the Token to remember the active session. And in your case, You are missing that token somewhere.
Example: https://stackoverflow.com/a/37396572/3851720
Note: On every call, Token must be pass from Browser Storage.

Brn.Rajoriya
- 1,534
- 2
- 23
- 35
-
this is not for authentication, I used token for authentication as you said. I want to use session. if I call API from CSR(ng serve) is ok. or call API when loaded app is ok, but if I reload page, the session is null, I guess sessionID call before render app is different with call after app render – vinh vuong hung Aug 17 '20 at 07:27