1

Notify Server (Web API on IIS) when cookie is Deleted. When user manually clears, browser cookies. How do I notify my website to immediately log-out the user.

Right now, when new request comes-in we redirect to sign-in in absence of cookie.

EDIT: To present an analogy, azure management portal logs out the user immediately, however here at stack overflow web page remains active until we make next request to SO.

Abhijeet
  • 13,562
  • 26
  • 94
  • 175

2 Answers2

2

Cookies are used to keep the user information in web browsers so that when another request is sent to server, server knows who the client is (login information etc.). As you have experienced after clearing the cache there is no login information stored in browser and when the next request goes server redirects you to the sign in page. Therefore this is not possible.

This is not related to User manually removing cookies, But from server side you can clear cookies as shown here and here.

Community
  • 1
  • 1
Nipuna
  • 6,846
  • 9
  • 64
  • 87
1

This isn't how the internet works. When I clear cookies on my machine, no request is sent anywhere. You can't know this.

Andy V
  • 987
  • 11
  • 16