locked
Destroy Session Variables RRS feed

  • Question

  • User-797751191 posted

    Hi

       I have below code . I want to clear all Session Values. Is the below code correct.

    Secondly how we can check that all Session variables are destroyed.

    try
            {
                if (Session["InvoiceNo"] != null)
                {
                    lblName.Text = Session["CustomerName"].ToString();
                    lblAddress.Text = Session["CustomerAddress"].ToString();
                    lblInvoiceNo.Text = Session["InvoiceNo"].ToString();
                }
            }
            catch (Exception ex)
            {
    
            }
            finally
            {
                Session.Abandon();
            }

    Thanks

    Monday, June 24, 2019 7:50 AM

Answers

All replies