0

I want to avoid some behavior from my web app when it is being used in an Iframe. The app use cookies for auth and I want to avoid authenticate the user automatically (using the cookies) when the app is inside an Iframe and the user has a new tab with the domain of my web app, already authenticated. The expected behavior happens on browsers that blocks third-party cookies, the user need to log in again in the iframe. Wondering if there is a way to check when the cookies comes from a third party using JavaScript and try to change the normal behavior for the cookies in iframes on browsers that does not block third-party cookies.

I want some information that could give a clue about how to fulfill my intention (if it is possible)

Thanks in advance

Javier Galarza
  • 28
  • 1
  • 2
  • 5
  • The way to tell if you're in an iframe is `if (window.top != window)` Cookies have nothing to do with it. – Barmar Mar 02 '23 at 20:34

0 Answers0