Refactored direct session get() and set().