title: Why does this hash syntax not work in Rails?
body: <pre><code>session[:user =&gt; user, :user_id =&gt; [user.id, user.salt]]
  </code></pre>
  
  <p>For some reason, that never worked for me.</p>
  
  <p>Thoughts on how I can achieve the following code in one line:</p>
  
  <pre><code>session[:user] = user
  session[:user_id] = [user.id, user.salt]
  </code></pre>