Why I am getting different principal_id when I logg in in other site with the same identity?
II principals are tied to the domain you log into. This is to limit cross-site tracking
Thanks!
Is it going to be the same for subdomains?
Like a.domain.com and b.domain.com are same principal_id?
It will only be different when the origin is different, the definition of an origin can be found here Origin - MDN Web Docs Glossary: Definitions of Web-related terms | MDN
In your subdomains example, both are different origins so they’ll result in different principals.
If both origins are under your control, e.g. they’re part of the same dapp, you can use the alternative frontend origins config to have the same principal.