Request.QueryString["Id"] is the same as Request["Id"]. This can be seen on your query string (ex. http://yoursite/yourDir/yourpage.aspx?
Id=3)
While the session is more like a storage available only on your active browser when the session was initiated.
Info about the code :
1. It performs a check if the Session is id named
"Id"
is not null.
if (!object.Equals(Session["Id"], null))
2. The condition is set that it will return true if the string saved on the Session["Id"] is equal to the querystring sent on the page.
if (Object.Equals(Session["Id"],Request.QueryString["Id"].ToString()))
3. The main purpose of that code is to check if the current id passed on that page is the same id the user used to login. That way, the system can prevent usage of the page by editing the query param Id with different id besides yours.
3. Code was done by a baby programmer.