using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["imie"] != null)
        {
            Label1.Visible = false;
            TextBox1.Visible = false;
            Button1.Visible = false;
        }
    }
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        Session.Add("imie", TextBox1.Text);
        HttpCookie ciasteczko = new HttpCookie("imie", TextBox1.Text);
        ciasteczko.Expires=DateTime.Today.AddDays(3);
        Response.Cookies.Add(ciasteczko);
        Response.Redirect("Default.aspx");
    }
}
