Getting values from session in C#

The below example shows how to retrieve the value from the session through its id.
//Storing UserName in Session
Session["UserName"] = txtUser.Text;


//Check weather session variable null or not
if (Session["UserName"] != null)
{
    //Retrieving UserName from Session
    lblWelcome.Text = "Welcome : " + Session["UserName"];
}
else
{
 //Do Something else
}