added function to retrieve sessionid