Tuesday 24 March 2020

Expressjs middleware not sending cookie to Angular front end.

I have my Angular front end calling my login function in my node express app and in the block of the controller, if my hashed passwords match, i set req.session.isLoggedIn = true;My session is set up using just the defaults before hitting any of my routes like so:​https://preview.redd.it/cbhqrrxmjoo41.png?width=458&format=png&auto=webp&s=8abb5df9a0cd9c2721b0705a2ff79596cdbfbcd3When i run my login on the front end, I am expecting the express session to send the cookie to my browser but nothing is there.Might be helpful to note that my node app is running on localhost:8080 and angular on localhost:4200.I do however get the cookie when I run my test request in postman so I am pretty sure it is on the Angular side. If this ends up being an Angular question, then I apologize for posting it in the wrong place.Any ideas? Thanks

Submitted March 24, 2020 at 08:28PM by NoControl712

No comments:

Post a Comment