Multiple Applications leveraging the same Authentication Session

Spent days in these forums trying to get a working implementation of this cross application session sharing for my nextjs and remix apps and finally got there. Wanted to post it in the forums that I had explored on the way in case it helps poor souls in the future stuck in this grind. Sharing session between 2 web apps on different subdomains - #12 by reubenh