Ruby Sinatra Session Management Available in Class Methods?

Question

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:

undefined local variable or method `session' for #<User:0x007fd6f4117ba0>
file: user.rb location: log_in line: 315

Would be nice to be able to toss session management inside methods instead of the routes. Using Sinatra's sessions:

enable :sessions


Show source
| class   | ruby   | session   | sinatra   2017-01-06 06:01 0 Answers

Answers to Ruby Sinatra Session Management Available in Class Methods? ( 0 )

Leave a reply to - Ruby Sinatra Session Management Available in Class Methods?

◀ Go back