title: How to get Session Id In C#
body: <p>what is the correct way to get session id in C#</p>
  
  <pre><code>String sessionId ;
  sessionId = Session.SessionID;
  </code></pre>
  
  <p>or</p>
  
  <pre><code> string sessionId = Request["http_cookie"];
   sessionId = sessionId.Substring(sessionId.Length - 24);
  </code></pre>
  
  <p>Actually i am totally new to C# and just jumped in a project where i find the second code and by Google i found the first code so anyone please tell me what is the actual code to be used</p>