encapsulate rails session