I am using asp.net C#; I create a session this type.
How get data from this session ?
using (envanterEntities envanter = new envanterEntities())
{
kullanicilar kull = new kullanicilar();
if (envanter.kullanicilar.Any(n => n.kullaniciAdi == txtUser.Text && n.parola == txtPass.Text))
{
Session["parola"] = envanter.kullanicilar.First(n=>n.kullaniciAdi==txtUser.Text && n.parola==txtPass.Text);// my session
Response.Redirect("MainPage.aspx?userName=" + txtUser.Text);
HttpCookie cookie1 = new HttpCookie("bilgi");
cookie1.Name = "bilgi";
cookie1.Expires = DateTime.Now.AddDays(30);
cookie1.Value = DateTime.Now.ToString();
}
Response.Redirectwill never be called. Nor would it have any meaning otherwise either, since you don't add the cookie to anywhere