I want to store login information of a user
globaly
. If user is logged in already , then if another user
want to login from another PC somewhere than application must warn him that another user
is also logged in with this name
.
I dont' want to use DataBase
. I think HttpApplication
is a solution. But I can't understand its flow.
What I know is , I have to assign values to it in Global.asax.cs
file :
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
Application["Username"] = "Test";
}
}
Now i want to access it in a controller
, in Login Function
where I would check if Application
has some data or not.
If it is null
than there is no user
logged in. But I don't understand how to access HTTPApplication
object and how to assign the username
to it in the Application_Start()
.