fixing login and logout sessions