pulled out test code for sessions