Set the session in the database