[rubis] (new:minor) Handle of back and end-of-session operations (currently are implemented as hack but can work)