session_base refactored