Creation of pre_authenticated_session locally and on server