Good morning everyone.
I am currently suffering from a problem and can not find the solution. I have a login system in ASP.NET C # when I do the authentication everything happens correctly only so that's the problem I need to get the ID value from my database from the user who was authenticated there by that time until the method that I use works, I review the value of the ID captured at login time for a public static variable in a class and it redirects me to the start screen that is correct with the value in the variable .. and then the problem happens, this variable does not save the value to the client's computer but in the server then when someone logs in to the site all the people who access this site will be automatically logged in this login all this because of the static variable in the class someone knows how to solve it is situation that is eating judgment.
Thank you in advance !! Kennedy
In my Global class
public static int Cod_Login;
My login validation
DataSet DS = new DataSet();
DS = ValidaLogin(TxtUsuario.Text, TxtSenha.Text);
for (int i = 0; i < DS.Tables[0].Rows.Count; i++)
{
Cod_User = Convert.ToInt32(DS.Tables[0].Rows[i][0] == DBNull.Value ? 0 : DS.Tables[0].Rows[i][0]);
}
if (Cod_User != 0)
{
Class_Global.Cod_Login = Cod_User; //aonde passo o valor para a variavel
Response.Redirect("/Default.aspx");
}
else
{
LblMsg.Text = "CPF e/ou Senha incorretos.";
LblMsg.Visible = true;
}
On my home page after login
if (Class_Global.Cod_Login != 0)
{
//aqui utilizo se o meu código caso for o valor diferente de zero
}