Storing login data

Hello everyone!

I am trying to build a simple school management system in console. Once a user login I want to store some of the data in order to avoid querying for that data again. What would be the best approach?

I thought of using static such as

 public static class Login
    {
        public static string login { get; set; }
        public static bool teacherFlag { get; set; }
        public static bool adminFlag { get; set; }

    }


But from what I read this approach is not good as multiple applications can mix up the information.
Was this page helpful?