Gathering detailed insights and metrics for @midwayjs/express-session
Gathering detailed insights and metrics for @midwayjs/express-session
Gathering detailed insights and metrics for @midwayjs/express-session
Gathering detailed insights and metrics for @midwayjs/express-session
🍔 A Node.js Serverless Framework for front-end/full-stack developers. Build the application for next decade. Works on AWS, Alibaba Cloud, Tencent Cloud and traditional VM/Container. Super easy integrate with React and Vue. 🌈
npm install @midwayjs/express-session
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (62.04%)
Shell (34.86%)
JavaScript (2.91%)
CSS (0.15%)
HTML (0.03%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
7,585 Stars
4,116 Commits
584 Forks
98 Watchers
33 Branches
174 Contributors
Updated on Jul 11, 2025
Latest Version
3.20.4
Package Id
@midwayjs/express-session@3.20.4
Unpacked Size
13.93 kB
Size
4.48 kB
File Count
14
NPM Version
lerna/7.4.2/node@v18.20.4+arm64 (darwin)
Node Version
18.20.4
Published on
Apr 10, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
4
Session component for @midwayjs/express
1$ npm i @midwayjs/express-session --save 2$ npm i @types/express-session --save-dev
@midwayjs/express has enabled this component by default.
We use cookie-session to keep session by default and use express-session when set custom session store.
You can configure session in your config.*.ts
.
default value.
1export const session = { 2 secret: undefined, // must be set in application 3 name: 'MW_SESS', 4 cookie: { 5 maxAge: 24 * 3600 * 1000, // ms 6 httpOnly: true, 7 // sameSite: null, 8 }, 9};
You can set 'session.cookie' for cookie-session config.
You can use compatible session store here.
Let's give an example for memorystore.
1import { Configuration, Inject } from '@midwayjs/core'; 2import * as session from '@midwayjs/express-session'; 3import MemoryStore = require('memorystore'); 4 5@Configuration({ 6 imports: [ 7 express, 8 session, 9 ], 10 //... 11}) 12export class AutoConfiguration { 13 @Inject() 14 sessionStoreManager: session.SessionStoreManager; 15 16 async onReady() { 17 this.sessionStoreManager.setSessionStore(MemoryStore, { 18 checkPeriod: 86400000 // prune expired entries every 24h 19 }); 20 } 21}
Another example for connect-redis.
1import { Configuration, Inject } from '@midwayjs/core'; 2import * as session from '@midwayjs/express-session'; 3import RedisStore from "connect-redis" 4import {createClient} from "redis" 5 6// Initialize client. 7let redisClient = createClient() 8redisClient.connect().catch(console.error) 9 10@Configuration({ 11 imports: [ 12 express, 13 session, 14 ], 15 //... 16}) 17export class AutoConfiguration { 18 @Inject() 19 sessionStoreManager: session.SessionStoreManager; 20 21 async onReady() { 22 // Initialize store. 23 this.sessionStoreManager.setSessionStore(RedisStore, { 24 client: redisClient, 25 prefix: "myapp:", 26 // ... 27 }); 28 } 29}
Please open an issue here.
MIT
No vulnerabilities found.
Reason
21 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
no binaries found in the repo
Reason
Found 3/17 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is not fuzzed
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
46 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More