adding sessions and finishing authentication