Skip to content

Correct the generated session comments - #59

Merged
crimson-knight merged 1 commit into
mainfrom
fix/session-comments
Nov 20, 2026
Merged

crimson-knight merged 1 commit into
mainfrom
fix/session-comments

Conversation

@crimson-knight

Copy link
Copy Markdown
Member

What was wrong

The session comments in every generated environment file (and the minimal config amber new writes from new_command.cr) promised two things Amber 2.0.0-beta.11, the release generated apps pin, does not do:

  • "signed_cookie keeps the session in the visitor's cookie ... and nothing is held on the server." beta.11's Session::Store#build ignores store and keeps every session in the memory adapter.
  • "memory (at most 10,000 sessions per process)." beta.11's MemorySessionAdapter has no size limit.

They also offered store: adapter, which beta.11's SessionConfig#validate! rejects, and said a session with expires: 0 lives "until evicted", though nothing evicts it.

What changes

The comments describe beta.11 as it behaves and point to amberframework/amber#1455, which makes the cookie stores keep nothing on the server, accepts store: adapter, and caps the memory adapter at session.max_memory_sessions (10,000 by default). The settings themselves are unchanged.

Once #1455 is released and the template pins that release, the comments can drop the beta.11 wording.

The generated environment files said that store: signed_cookie keeps
nothing on the server and that the memory adapter holds at most 10,000
sessions per process. Amber 2.0.0-beta.11, which generated apps pin,
does neither: it keeps every session in the memory adapter whatever
store says, the memory adapter has no size limit, and store: adapter
fails validation. A session with expires: 0 is never removed either.

The comments now describe beta.11 as it is and name
amberframework/amber#1455, which makes cookie stores keep nothing on the
server, accepts store: adapter, and caps the memory adapter at
session.max_memory_sessions (10,000 by default).
@crimson-knight
crimson-knight merged commit 161a1ee into main Nov 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant