title: How secure are PHP sessions?
body: <p>I'm primarily a C++ programmer, but I'm trying to pick up some PHP.</p>
  
  <p>Apparently the way to implement web user sessions is to store the user's login ID in a cookie using the $_SESSION variable.</p>
  
  <p>Is it not possible for someone to just modify their cookie, to give them different privileges or log in as a different user?</p>
  
  <p>It seems like this authentication mechanism is just having the user store their ID in a file - and then just trusting them not to change it.</p>
  
  <p>Is there something that prevents this?</p>
  
  <p>Thanks!</p>