title: how safe is it to use session variables - asp.net / c#
body: <p>So basically i'm wondering how safe is my way of using Session variables.</p>
  
  <p>I have a login form where user types his username/password, it gets parametrized then queried, if username/password exists, then a userID is returned from db table. This is unique for every user.</p>
  
  <p>when i have this value, this is where i'm wondering whether this way is safe way of storing the userID inside the session variable uID? anyhow this is how i do it,</p>
  
  <pre><code>Session["uID"] = (int)dt.DefaultView[0]["userID"];
  
  FormsAuthentication.RedirectFromLoginPage(username.Text, false);
  
  Response.Redirect("userPage.aspx", false);
  </code></pre>
  
  <p>then the page is redirected to another page where i use the session variable to fetch the users tables from the db.</p>
  
  <p>Thanks in advance for your feedback </p>