logout and simple write to db