Suppose,we have 2 Session Keys as Name and Middle,so after looping through the Session Keys,it will print Values
Session["Name"] = "Vishal";
Session["Middle"] = "K";
VB.NETDim session_keys as string = string.Empty
For Each session_keys In Session.Keys
Response.Write("Session Key Contain-> " + Session[session_key].ToString() + "</br>")
Next
C#foreach (string session_key in Session.Keys)
{
Response.Write("Session Key Contain-> " + Session[session_key].ToString() + "</br>");
}
Output
Session Key Contain-> Vishal
Session Key Contain-> K