set user session var in a seperate function