Reset session inside a model?

Can I reset / delete the session from a model (rather than from a

When a visitor to my site logs out, all the information they entered
into the DB and files created while they were using the site are deleted
and then I reset their session. I’m trying to move the cleanup from my
controller into my model.

Everything works fine in the controller, but I’m getting an " undefined
local variable or method ‘reset_session’ " error when I call
reset_session in the model.


Its probobly not the best idea to have session handling inside your
business logic.

Instead, you could implement a “reset” method for models that the user
will be using throughout a session and call it from the appropriate
action in your controller.

#controller file…
class MyController
def logout

hope that helps.