0

I have a ASP.NET MVC application. I integrated it with Facebook. It works but here is a strange problem. If i open a incognito window it works. But it not works in normal window. Could there be a cookie problem or?

What's your suggest?

//loginInfo is always null except incognito window
var loginInfo = await _authenticationManager.GetExternalLoginInfoAsync();

if (loginInfo == null)
{
    return RedirectToRoute("UserLogin");
}
Yargicx
  • 1,704
  • 3
  • 16
  • 36

1 Answers1

0

It seems that there already exists a local cookie containing authenticated information in the browser. It is recommended that we clear the locally stored browser data before testing the logic, and thus try it again.
enter image description here
Feel free to let me know if there is anything I can help with

Abraham Qian
  • 7,117
  • 1
  • 8
  • 22
  • yes you are right but my old customers can't do this. because i have an ecommerce application and i have not logged in or not. do you have any solution for my customers? – Yargicx Jun 30 '20 at 16:26
  • This is common, we have to switch to other private windows to log in the same website using another account since the browser will automatically search the cookie for the current domain. Try to check the cookie name for current website by Press F12 in the browser. Then you could delete the cookie referring to the below code snippets. https://stackoverflow.com/questions/20219068/how-do-i-manually-delete-a-cookie-in-asp-net-mvc-4 – Abraham Qian Jul 02 '20 at 09:06