Hey Nargis, you can use following methods to get Webdriver SessionId in Selenium:
System.setProperty("webdriver.chrome.driver", "..//chromedriver.exe");
// Launching Chrome browser.
driver = new ChromeDriver();
SessionId sessionid = ((RemoteWebDriver) driver).getSessionId();
System.out.println(sessionid);