0

The following code describes my middleware to handle the login requests into my portal. On successful password validation, it sets the 'Set-Cookie' header to the response and responds back with HTTP Status Code 200.

Snapshot of the response from the server side is attached here. It's absolutely perfect.

However, the XSRF-TOKEN is not being set as a cookie in the user agent.

I am using AngularJS 1.6.9 on the front-end and I need this cookie set in my browser for subsequent requests.

My Back-End is powered by Express. It is hereby an earnest request to let me know what exactly I'm doing wrong! Thanks in advance.

Can anyone please help me in setting my session cookie to the user agent?

Keren Caelen
  • 1,466
  • 3
  • 17
  • 38
  • 1
    I can easily set the cookie by passing the data through the response body and then using the $cookie service of AngularJS. But this is the thing I don't want to do. – Arka Halder May 08 '18 at 05:27
  • I am terribly sorry for my stupidity! I was sending the cookie with secure = true, but my app was live on http, not on https! Problem has been solved by myself. – Arka Halder May 08 '18 at 06:35

0 Answers0