Vue JS Cookie not set in Request Headers
Problem:
I was just learning VueJS and wrote a method to get some JSON data but I noticed that the current session of the user was not sent with the call. My code is as follows
I was just learning VueJS and wrote a method to get some JSON data but I noticed that the current session of the user was not sent with the call. My code is as follows
Ideally what I am trying to solve here is an error that usually occurs when you are trying to server data to a different domain. You will usually get an error saying something similar to the below
Cross-Origin Request Blocked
So how do we now get rid of this assuming we are using a NodeJS server to serve the data. Easy we just add the cors module. SO here is the code