How to do an applifecycle listener in rails?


In jsp, we have applifecycle listeners. For each user that logs on, and
the app is started, and when session variable is changed, you can
specify a
function to run.

Is there something like this in Rails and any example code???