hi,
i am using in my login page one session variable and assigning the value of username fine this i am getting in required page it is working fine,
all here i want to capture the Session time out how to do that i have tried the below code it is not working can any one help me out with an example or whats wrong in my code the code as follows
the below line i am writing in my login page
Session["UserLoginName"] = TextBox1.Text;
and i am capturing this in another form like this
S_UserLoginName= (string)Session["UserLoginName"];
Lblsession.Text = S_UserLoginName;
this is working fine for capturing expiration in global.asax
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session["CustomSessionId"] = Guid.NewGuid();
}
and in my another form i am checking like this
if (!Page.IsPostBack)
{
if (Session["CustomSessionId"] == null)
{
Response.write("Your session is expired please login again");
}
else
{
}
}
the above code i got it from one site
can any one help me out how to capture session expiration
thank you
i am using in my login page one session variable and assigning the value of username fine this i am getting in required page it is working fine,
all here i want to capture the Session time out how to do that i have tried the below code it is not working can any one help me out with an example or whats wrong in my code the code as follows
the below line i am writing in my login page
Session["UserLoginName"] = TextBox1.Text;
and i am capturing this in another form like this
S_UserLoginName= (string)Session["UserLoginName"];
Lblsession.Text = S_UserLoginName;
this is working fine for capturing expiration in global.asax
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Session["CustomSessionId"] = Guid.NewGuid();
}
and in my another form i am checking like this
if (!Page.IsPostBack)
{
if (Session["CustomSessionId"] == null)
{
Response.write("Your session is expired please login again");
}
else
{
}
}
the above code i got it from one site
can any one help me out how to capture session expiration
thank you