Usually we use
method to destroy all objects stored in session object if a user logs out.
If you need to clear only a particular session object, set it to null.
Session["loginid"] = null;
And do a null check wherever you need to check if it has any value or not.
if (Session["loginid"] == null)
Session["loginid"] = "";
still refers to a memory location, but if you assign the session object a null value, it will no more refer to any memory location, which in your case makes more sense.
BTW I also notice a syntax error in your code, if (Session["loginid";
].ToString() == "")
The semi colon shouldn't be there.
Hope this helps!