Cookies with IE11
Hey guys,
Currently building an internal .net core web application that uses cookies to send a user's role to the client. Everything works fine while using chrome, the browser saves the cookie. Today, I decided to check if my project works in IE11 to find out that the cookie is not saved at all.
if (!httpContext.Request.Cookies.Keys.Contains("Role")) { CookieOptions option = new CookieOptions(); option.Expires = DateTime.Now.AddHours(3); var user = httpContext.User.Identity.Name; var role = roleRepository.Get(userRepository.Get(user).RoleID).Value; httpContext.Response.Cookies.Append("Role", role, option); } // blah blah
This is the segment that actually creates the cookie and then appends it to the pipeline. Once again, in chrome everything works fine but in IE11 it's not registering the cookie at all.
I did some research and many mentioned about domains with underscores but I'm developing on localhost so I'm not all too sure if that's an issue.
Thanks in advance!
0 comments:
Post a Comment