I defined my session variable, in my Global.asax called user like this
protected void Session_Start(object sender, EventArgs e)
{
Session["idMap"] = "";
Session["user"] = "";
}
Also i have a asp:Login in where i set the value of the session variable in the event of loggedIn
protected void lgnMapZone_LoggedIn(object sender, EventArgs e)
{
Session.Abandon();
Session["user"] = lgnMapZone.UserName;
}
My problem it’s that when the users it’s autenthicated, the void session_start it’s called and erase my variable, how can i solved this??
Session.Abandon()destroys the session and theSession_OnEndevent is triggered. You should call this method when the user does a logout instead of log in.You should probably call
Session.Clear()which just removes all values (content) from the session Object while logging in.This will resolve the issue that you have now.