adding function to extract userId from Session