abstracted session check into middlewear