I am using angular Spa template with .net core 2.0 and angular 4.
I am getting zero count of cookies after page refresh. and in fact I am not getting anything in HttpContext after page gets refreshed.
it's working fine if I uses angular system menu.
Now, here is my code for getting cookie in back end.
private string GetCookie(HttpContext httpContext, string cookieName)
{
var rqstCookie = httpContext.Request.Cookies[cookieName];
return !string.IsNullOrEmpty(rqstCookie) ? rqstCookie : null;
}
one important thing is that when I click in menu, it loads component and service files and then it requests to C# controller with all headers and options. but when I refresh page this whole process get skipped, so I think this options are not delivered to back end and that's why my cookies are empty.
in my other applications, I have used url rewrite for same kind of issues and it worked over there but here because this application is angular spa template, url rewrite is not working.
I have also tried to setup the url rewrite, the same way I did in my old applications, but it gives me error. here is the link of the url rewrite module that I followed. https://mcmap.net/q/157185/-how-do-i-configure-iis-for-url-rewriting-an-angularjs-application-in-html5-mode
I have updated cookies to Session cookie but it's also not working.
can you guide me how to get all the cookies and other data even when user refreshes page. thanks...