Skip to content

Add new Express session option#220

Merged
colinrotherham merged 6 commits intomainfrom
async-sessions
Feb 26, 2026
Merged

Add new Express session option#220
colinrotherham merged 6 commits intomainfrom
async-sessions

Conversation

@colinrotherham
Copy link
Copy Markdown
Contributor

@colinrotherham colinrotherham commented Feb 3, 2026

This PR adds support for an (optional) Express session option for custom session stores

This change unblocks NHSDigital/manage-vaccinations-in-schools-prototype#178 and uses:

  • req.session.regenerate() during session reset
  • req.session.save() after session reset
const prototype = await NHSPrototypeKit.init({
  session: expressSession({
    secret: 'Shhh'
  })
})

We should test this feature with various asynchronous session stores

@colinrotherham colinrotherham added the enhancement New feature or request label Feb 3, 2026
@colinrotherham colinrotherham force-pushed the async-sessions branch 5 times, most recently from f0e33ec to 5d084e4 Compare February 6, 2026 11:24
@colinrotherham colinrotherham changed the base branch from main to nunjucks-globals February 6, 2026 11:26
@colinrotherham colinrotherham changed the title Add new Express.js session option Add new Express session option Feb 6, 2026
@colinrotherham colinrotherham force-pushed the nunjucks-globals branch 2 times, most recently from d4f6448 to a5e6475 Compare February 23, 2026 09:33
@frankieroberto frankieroberto moved this from Todo to Being reviewed in NHS prototype kit project board Feb 23, 2026
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this file have a (very basic) test now? Or is this considered a private / internal function?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to add one

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited a62ef54

@colinrotherham colinrotherham changed the base branch from nunjucks-globals to main February 26, 2026 10:15
@colinrotherham
Copy link
Copy Markdown
Contributor Author

Ready to review again @frankieroberto

I've added .env file support in f4bd3e6


Demo PR to test either cookie-session and connect-pg-simple

@colinrotherham colinrotherham merged commit 69d3f37 into main Feb 26, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Being reviewed to Done in NHS prototype kit project board Feb 26, 2026
@colinrotherham colinrotherham deleted the async-sessions branch February 26, 2026 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

2 participants