
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@bonio-tw/session-manager
Advanced tools
yarn add @bonio-tw/session-manager
import { initSessionManager } from '@bonio-tw/session-manager';
// app or web storage
// https://developer.mozilla.org/zh-TW/docs/Web/API/Storage
const customStorage = {};
const sessionManager = initSessionManager({
storage: customStorage,
});
required
getItem
、setItem
、removeItem
接口optional
optional
uuidv4
optional
uuidv4
const sessionManager = initSessionManager({
storage: customStorage,
sessionIdTTL: 30 // 30s
generateSessionId: () => `mySessionId`,
generateClientId: () => `myClientId`
});
getSession:返回當前的 sessionId
及 clientId
sessionIdTTL
,複寫當次 getSession 時要使用的 ttl 時間。使用 0 代表 sessionId 不會因為閒置而過期。clearSession:清空當前 storage 中紀錄的 session 資訊
const session = await sessionManager.getSession({sessionIdTTL: 0});
// 不檢查是否已經超過 sessionId 的閒置時間
console.log(session)
// { sessionId: 'mySessionId', clientId: 'myClientId' }
await sessionManager.clearSession();
FAQs
## Setup `yarn add @bonio-tw/session-manager`
The npm package @bonio-tw/session-manager receives a total of 1 weekly downloads. As such, @bonio-tw/session-manager popularity was classified as not popular.
We found that @bonio-tw/session-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.