title: Ruby Sinatra Session Management Available in Class Methods?
body: <p>Just wondering if the scope of a session is manageable inside a custom object.  I'm getting the following error while trying to set a session variable inside a method for a user:</p>
  
  <pre><code>undefined local variable or method `session' for #&lt;User:0x007fd6f4117ba0&gt;
  file: user.rb location: log_in line: 315
  </code></pre>
  
  <p>Would be nice to be able to toss session management inside methods instead of the routes.  Using Sinatra's sessions:</p>
  
  <p><code>enable :sessions</code></p>