better code support for sessions