title: Is session a method or hash in Rails? Slightly confused
body: <p>Got a really simple question. I'm doing the railstutorial by Michael Hartl and it talks about using the session method:</p>
  
  <p>Logging a user in is simple with the help of the session method defined by Rails... We can treat session as if it were a hash, and assign to it as follows:</p>
  
  <pre><code>session[:user_id] = user.id
  </code></pre>
  
  <p>It says you can treat session as if it were a hash, but I'm confused because it is called the session method, so is anything actually being called? My guess is that by inserting into the session hash, there is a session function that looks into the hash to see if there is anything present? I'm not really sure how it works.</p>