How to login into wordpress in both cross-origin (iframe) and same-origin scenario?

Solution:

Add this line in the header module section of the .htaccess file.

Header always edit Set-Cookie (.*) "$1; SameSite=None; Secure

Hope that’s help!