Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Restrict only one user to login at a time


Message #1 by "mvv ramesh" <mvvramesh@h...> on Wed, 13 Sep 2000 01:26:48 GMT
you coule try something like this:

/*add a boolean "adminLoggedOn" in your global.asa as an application level
variable, ie;*/


function Application_OnStart()
{
   Application("adminID") = "yourAdminID";
   Application("boolOn") = false;
}


/*
:::add a cookie to the admin browser with his user id:::
*/


function Session_OnStart()
{
if(Application("boolOn") != false)
{
   Server.Transfer("loginFail.asp")
}
else
{
   var test = Request.Cookie("yourcookie").("yourkey").value
   if(test== Application("adminID"))
   Application("boolOn") = true;
}
}





basic idea.. hope it helps


  Return to Index