Tyler MacDonald wrote,
This must seem like a silly question to those of you in the know, but
digging around http://api.rubyonrails.com/ doesnt get my anywhere.
How do I retrieve a session based on it’s ID? I’d expect something like
my_session = ActiveController::Sessions.find_by_id(session_id)
But I can’t find anything even remotely similar to that in the API…
That’s because, for the most part, you won’t ever need to do that. The
Rails architecture protects you from having to figure out that crap. If
need to, for example, delete the current session, you just do
session.destroy. If you need to access a session variable for the
session, you just do session[:variable_of_interest]. As you learn more
about Rails, you’ll understand why that’s true. If you have some reason
doing more than that kind of stuff, you’ll need to say more about what
you’re trying to do. Most often, though, folks new to Rails find things
like this are just much easier than they’re used to.