ASP.NET Request.Cookies ["cookie"] returns null in IE on initial request

We use openSSO to authenticate our website. When the user authenticates, openSSO redirects to what the url originally requested. This, of course, is standard. What is unusual is that in IE, when the user is redirected, Request.Cookies ["cookie"] is called. The value is empty in IE, but it works in Firefox, Request.Cookies ["cookie"] is added by openSSO, of course.

I checked the fiddler, firebug files, the cookie is definitely set (hence it works in FF) The only way I can get this to work in IE is that after the initial redirect from opensso I really refresh the page using F5, then everything works as expected.

What is even more unusual is that the cookie is empty on the initial redirect after authentication. But adding "javascript: alert (document.cookie)"; in the url line, it shows that even in IE cookie values ​​exist, just Request.Cookies ["cookie"]. The value thinks it is empty (note that it is NOT null, only the value is empty)

Any help would be appreciated

+4
source share
1 answer

This is what I also see. Cookies are not redirected to the page after the redirect. It happens due to poor browser synchronization.

One work I do is that I am using the middle redirect page, so the browser has time to save the cookie and the next page will receive it.

For example, I am doing this sequence. LoginPage -> middleHiddenCheckPage -> FinalRedirectedPage.

0
source

Source: https://habr.com/ru/post/1346810/


All Articles