How to make an gameObject refered across scenes?

I make an online game which has two scenes, one is the login scene and the other is the main game scene. And I want to use an game object which serves as an network component which keeps the login states and other network related data.
The problem is that how can I make this game object get refered in the both scenes since after the user login, the main scene needs to use the scripts attached to the game object. How can I do it? I need you help, thanks!

There’s a few options. The easiest is just to grab a reference to the object as soon as the next scene loads. Just give the object its own unique tag and find it by that tag. You’d set the object to DontDestroyOnLoad so it isn’t destroyed when the previous scene unloads.