{"record":{"id":"b1e6062241451832","repo":"jackwener/OpenCLI","slug":"linkedin-jsessionid-cookie-not-found-please-sign-b1e606","errorCode":null,"errorMessage":"LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn in the browser.","messagePattern":"LinkedIn JSESSIONID cookie not found\\. Please sign in to LinkedIn in the browser\\.","errorType":"error_code","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/linkedin/people-search.js","lineNumber":213,"sourceCode":"        try {\n            await page.goto(buildSearchUrl(keywords));\n            await page.wait(6);\n        } catch (error) {\n            throw new CommandExecutionError(`LinkedIn people search navigation failed: ${error?.message || error}`);\n        }\n\n        let cookies;\n        try {\n            cookies = await page.getCookies({ url: 'https://www.linkedin.com' });\n        } catch (error) {\n            throw new CommandExecutionError(`LinkedIn cookie lookup failed: ${error?.message || error}`);\n        }\n        if (!Array.isArray(cookies)) {\n            throw new CommandExecutionError('LinkedIn cookie lookup returned malformed payload');\n        }\n        const jsession = cookies.find((c) => c.name === 'JSESSIONID')?.value;\n        if (!jsession) {\n            throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn in the browser.');\n        }\n\n        let result;\n        try {\n            result = unwrapEvaluateResult(await page.evaluate(extractionScript()));\n        } catch (error) {\n            throw new CommandExecutionError(`LinkedIn people search extraction failed: ${error?.message || error}`);\n        }\n        if (result?.error) {\n            if (looksLinkedInAuthWall(`${result.url || ''} ${result.error || ''}`)) {\n                throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn people search requires an active signed-in browser session.');\n            }\n            // If LinkedIn redirected away from the search page that\n            // usually means CUL was reached or the account is gated.\n            throw new CommandExecutionError(`LinkedIn redirected away from the search page (${result.error}). Likely Commercial Use Limit reached - the limit resets on the 1st of next month.`);\n        }\n        if (!result || typeof result !== 'object') {\n            throw new CommandExecutionError('LinkedIn people search returned malformed extraction payload');","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linkedin/people-search.js#L195-L231","documentation":"The command needs the JSESSIONID cookie to authenticate subsequent LinkedIn calls. After extracting cookies it searches for name === 'JSESSIONID'; if absent (or empty value), it throws AuthRequiredError telling the user to sign in to LinkedIn in the controlled browser. This is an auth error, not a code bug.","triggerScenarios":"Browser session exists and cookies were read successfully, but no JSESSIONID cookie is present for https://www.linkedin.com — the user never logged in, the session expired, LinkedIn set a logged-out cookie set, or cookies were cleared.","commonSituations":"Fresh browser profile with no LinkedIn login; LinkedIn session expired (weeks-old profile); using a cookie jar / incognito profile that does not persist login; logged out manually before running the command; corporate environment blocking linkedin.com session cookies.","solutions":["Open the controlled browser, sign in to LinkedIn manually, then re-run the command","Export/import a browser profile that already has an active LinkedIn session","Verify JSESSIONID exists (DevTools > Application > Cookies on linkedin.com) before running","Catch AuthRequiredError in your tooling and prompt the user to authenticate"],"exampleFix":"// before\nawait cli('linkedin people-search', { keywords: 'sre berlin' });\n// after: ensure session first\nawait cli('browser open'); // then sign in to linkedin.com interactively\nawait cli('linkedin people-search', { keywords: 'sre berlin' });","handlingStrategy":"validation","validationCode":"const cookies = await page.getCookies({ url: 'https://www.linkedin.com' });\nif (!cookies.some((c) => c.name === 'JSESSIONID' && c.value)) {\n  throw new Error('Not signed in to LinkedIn: open the browser and log in first');\n}","typeGuard":"const hasLinkedInSession = (cookies) => Array.isArray(cookies) &&\n  cookies.some((c) => c.name === 'JSESSIONID' && Boolean(c.value));","tryCatchPattern":"try { await cli('linkedin people-search', args); }\ncatch (e) { if (e.name === 'AuthRequiredError' || /JSESSIONID/.test(e.message)) { await promptLinkedInLogin(); return retry(); } throw e; }","preventionTips":["Sign in to LinkedIn in the controlled browser before batch searches","Use a persistent browser profile so sessions survive restarts","Check cookie expiry; re-login when JSESSIONID disappears","Handle AuthRequiredError by routing users to an interactive login flow"],"tags":["authentication","linkedin","cookies","session-expired"],"backgroundTag":"missing-session-cookie","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}