Do different port number in url count as separate domain?

I’m trying to enable users to be able to sign into app1 and for app2 to recognize that they’ve signed into app1 and to use that authentication to sign them into app2, I’m using an Enterprise MS AD authentication method, for testing purposes, I want to run an app locally, for instance on localhost:3000 and another on localhost:8000 then sign in on the app that uses port 3000 to check if the app on port 8000 can see that I’ve signed in on the app that uses 3000, in production would be that the user would sign in on and then I’d want to recognize it, so for testing purposes, do the port numbers count as different domains?