Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Allow configuring login cookie with an expiry duration

オープン
#7,301 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

src/node/http.ts の328行目付近から始め、設定引数がどのように定義され、読み取られているかを追ってください。ログインCookieの有効期限を任意で設定できる項目を追加し、未指定または0の場合はセッションCookieの動作を維持してください。設定した期間によって、ブラウザを閉じた後もログインCookieが保持されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

enhancement

What is your suggestion?

Allow configuring an (optional) expiry age for the login cookie so that it persists beyond a browser session. This is handy for not re-entering the password every time.

Possible change:
https://github.com/coder/code-server/blob/main/src/node/http.ts#L328

...
return {
  domain: getCookieDomain(url.host, req.args["proxy-domain"]),
  path: normalize(url.pathname) || "/",
  sameSite: "lax",
  // Load, if provided, max age for login cookie. 0 means it becomes a Session cookie (according to Express docs)
  maxAge: getConfigCookieMaxAgeAsMilliseconds() || 0,
}

Why do you want this feature?

I want to maintain my login status even after closing the browser (as the Cookie is currently session-only). Say keep the login cookie for a week or a month. Adding a max-age changes the cookie from Session to persistent for the given duration using Express' maxAge parameter (docs).

Are there any workarounds to get this functionality today?

No, none directly. User can manually edit the cookie in Devtools

Are you interested in submitting a PR for this?

I'm not that familiar with how to make new configuration argument and also how the config args are read (there's some middleware for args IIRC, but not sure how to use that). But I can give it a go, with some help.

The above given change should be roughly all that's needed, sans the config reading.

主要言語
TypeScript
スター
79.4k
フォーク
6.9k
平均マージ
2日 13時間
マージ済み PR(30日)
39

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/code-server のほかの issue

coder/code-server の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。