$id = $request->cookies->get('PHPSESSID');
This will return the value of the 'PHPSESSID' cookie sent by the browser.