René's URL Explorer Experiment


Title: Add --cookie-max-age to keep the login cookie across browser sessions by harshbhx · Pull Request #8147 · coder/code-server · GitHub

Open Graph Title: Add --cookie-max-age to keep the login cookie across browser sessions by harshbhx · Pull Request #8147 · coder/code-server

X Title: Add --cookie-max-age to keep the login cookie across browser sessions by harshbhx · Pull Request #8147 · coder/code-server

Description: Fixes #7301 Summary Adds an opt-in --cookie-max-age flag so the login cookie can outlive the browser session. Problem The login cookie is set without Max-Age/Expires, so it is a session cookie and users must log in again every time the browser is closed (#7301). There is no setting to change this. Solution A new numeric flag cookie-max-age. When set, the cookie set in src/node/routes/login.ts gets maxAge = seconds * 1000. Without the flag behaviour is unchanged. Non-positive or non-numeric values throw at startup, like --idle-timeout-seconds. The max age is added at login only, not in getCookieOptions, because logout reuses those options to clear the cookie. Changes File Change src/node/cli.ts new cookie-max-age option, description, validation src/node/routes/login.ts apply maxAge when setting the login cookie CHANGELOG.md Unreleased entry test/unit/node/cli.test.ts parsing and validation test/unit/node/routes/login.test.ts login sets Max-Age=3600 with the flag, no Max-Age/Expires without it Before / After Before: Set-Cookie: code-server-session=...; Path=/; HttpOnly; SameSite=Lax After (--cookie-max-age=3600): ...; Max-Age=3600; Expires=... How to test PASSWORD=x code-server --cookie-max-age 3600, log in, check the cookie expiry in devtools; restart the browser and confirm you are still logged in. Without the flag the cookie is still a session cookie. Testing done New unit tests; the two login tests and the cli test fail without the change, pass with it (96/96 in cli + login suites) Prettier check on the touched files Full suite and e2e only via fork CI; not tried in a real browser Notes for reviewers Documented in the CHANGELOG and --help. No env var yet; happy to add CODE_SERVER_COOKIE_MAX_AGE if you want one.

Open Graph Description: Fixes #7301 Summary Adds an opt-in --cookie-max-age <seconds> flag so the login cookie can outlive the browser session. Problem The login cookie is set without Max-Age/Expires, so it is a ses...

X Description: Fixes #7301 Summary Adds an opt-in --cookie-max-age &lt;seconds&gt; flag so the login cookie can outlive the browser session. Problem The login cookie is set without Max-Age/Expires, so it ...

Opengraph URL: https://github.com/coder/code-server/pull/8147

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5f59f51e-ec4c-9bec-e479-a9c0c58dd74e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAD9C:22033E:65C8A4:894937:6B044264
html-safe-nonced512a0c9c4e95089fdbcf0bcc4e537dd73f1e74868a3eb02db59faf7b154b688
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDlDOjIyMDMzRTo2NUM4QTQ6ODk0OTM3OjZCMDQ0MjY0IiwidmlzaXRvcl9pZCI6IjI1NzAwNTQ0MjY4MDMwNjEzNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd75bcb12aea61977f4d13c9661d4b63002d09a1d6a128a8657afcf1d763f9504
hovercard-subject-tagpull_request:5401797750
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/coder/code-server/pull/8147/files
twitter:imagehttps://avatars.githubusercontent.com/u/155092207?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/155092207?s=400&v=4
og:image:altFixes #7301 Summary Adds an opt-in --cookie-max-age <seconds> flag so the login cookie can outlive the browser session. Problem The login cookie is set without Max-Age/Expires, so it is a ses...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/coder/code-server git https://github.com/coder/code-server.git
octolytics-dimension-user_id95932066
octolytics-dimension-user_logincoder
octolytics-dimension-repository_id172953845
octolytics-dimension-repository_nwocoder/code-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id172953845
octolytics-dimension-repository_network_root_nwocoder/code-server
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release06dc448a76fe4751ac1db26524aefa3aa3e889a8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/coder/code-server/pull/8147/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F8147%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcoder%2Fcode-server%2Fpull%2F8147%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=coder%2Fcode-server
Reloadhttps://github.com/coder/code-server/pull/8147/files
Reloadhttps://github.com/coder/code-server/pull/8147/files
Reloadhttps://github.com/coder/code-server/pull/8147/files
coderhttps://github.com/coder
code-serverhttps://github.com/coder/code-server
Codehttps://github.com/coder/code-server
Issues147 (147)https://github.com/coder/code-server/issues
Pull requests15 (15)https://github.com/coder/code-server/pulls
Discussionshttps://github.com/coder/code-server/discussions
Actionshttps://github.com/coder/code-server/actions
Projectshttps://github.com/coder/code-server/projects
Security and quality3 (3)https://github.com/coder/code-server/security
Insightshttps://github.com/coder/code-server/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fcoder%2Fcode-server%2Fissues%2Fnew%2Fchoose
harshbhxhttps://github.com/harshbhx
coder:mainhttps://github.com/coder/code-server/tree/main
harshbhx:fix/7301-cookie-max-agehttps://github.com/harshbhx/code-server/tree/fix/7301-cookie-max-age
Conversation 0 https://github.com/coder/code-server/pull/8147
Commits 2 https://github.com/coder/code-server/pull/8147/commits
Checks 10 https://github.com/coder/code-server/pull/8147/checks
Files changed https://github.com/coder/code-server/pull/8147/files
Please reload this pagehttps://github.com/coder/code-server/pull/8147/files
Add --cookie-max-age to keep the login cookie across browser sessions https://github.com/coder/code-server/pull/8147/files#top
Show all changes 2 commits https://github.com/coder/code-server/pull/8147/files
83dac5b Add --cookie-max-age to keep the login cookie across browser sessions harshbhx Nov 17, 2026 https://github.com/coder/code-server/pull/8147/commits/83dac5b005d7ec9d69d27c87a4c9a89cf6483a05
7b570f7 Add changelog entry for --cookie-max-age harshbhx Nov 17, 2026 https://github.com/coder/code-server/pull/8147/commits/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f
Clear filters https://github.com/coder/code-server/pull/8147/files
Please reload this pagehttps://github.com/coder/code-server/pull/8147/files
Please reload this pagehttps://github.com/coder/code-server/pull/8147/files
CHANGELOG.md https://github.com/coder/code-server/pull/8147/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
cli.ts https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
login.ts https://github.com/coder/code-server/pull/8147/files#diff-f6db95b59348a4590938a6dd611582281ae1b80917bfc1556302e116828655f5
cli.test.ts https://github.com/coder/code-server/pull/8147/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
login.test.ts https://github.com/coder/code-server/pull/8147/files#diff-48efa1eb16055644feffc27b24a9c5ffc2c4cd59db1b3146e1d8839000610538
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
CHANGELOG.mdhttps://github.com/coder/code-server/pull/8147/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
View file https://github.com/coder/code-server/blob/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f/CHANGELOG.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8147/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8147/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/coder/code-server/pull/8147/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
src/node/cli.tshttps://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
View file https://github.com/coder/code-server/blob/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f/src/node/cli.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8147/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/pull/8147/files#diff-e1f89aee8992fa7022cc43adb93042f9bbb4b223f0d6cd0e70719cf4b795afa4
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
src/node/routes/login.tshttps://github.com/coder/code-server/pull/8147/files#diff-f6db95b59348a4590938a6dd611582281ae1b80917bfc1556302e116828655f5
View file https://github.com/coder/code-server/blob/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f/src/node/routes/login.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8147/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8147/files#diff-f6db95b59348a4590938a6dd611582281ae1b80917bfc1556302e116828655f5
https://github.com/coder/code-server/pull/8147/files#diff-f6db95b59348a4590938a6dd611582281ae1b80917bfc1556302e116828655f5
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
test/unit/node/cli.test.tshttps://github.com/coder/code-server/pull/8147/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
View file https://github.com/coder/code-server/blob/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f/test/unit/node/cli.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8147/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8147/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
https://github.com/coder/code-server/pull/8147/files#diff-259502f3217ff57aa0efe8405a96d85558f638b6a1a27a3f772f7dda96ddc8f2
https://github.com/coder/code-server/blob/main/.github/CODEOWNERS#L1
test/unit/node/routes/login.test.tshttps://github.com/coder/code-server/pull/8147/files#diff-48efa1eb16055644feffc27b24a9c5ffc2c4cd59db1b3146e1d8839000610538
View file https://github.com/coder/code-server/blob/7b570f7cc6c3866853e7b852fd9dc1c8af9b163f/test/unit/node/routes/login.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/coder/code-server/pull/8147/{{ revealButtonHref }}
https://github.com/coder/code-server/pull/8147/files#diff-48efa1eb16055644feffc27b24a9c5ffc2c4cd59db1b3146e1d8839000610538
https://github.com/coder/code-server/pull/8147/files#diff-48efa1eb16055644feffc27b24a9c5ffc2c4cd59db1b3146e1d8839000610538
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.