setting up remote database and session