Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

next-session

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-session - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

1

lib/memory-store.d.ts
import { SessionData, SessionStore } from "./types";
export default class MemoryStore implements SessionStore {
store: Map<string, string>;
constructor();
get(sid: string): Promise<SessionData | null>;

@@ -5,0 +6,0 @@ set(sid: string, sess: SessionData): Promise<void>;

4

lib/memory-store.js
export default class MemoryStore {
store = new Map();
constructor() {
this.store = new Map();
}

@@ -4,0 +6,0 @@ async get(sid) {

@@ -5,3 +5,3 @@ import { IncomingMessage, ServerResponse } from "http";

session?: Session;
}, res: ServerResponse) => Promise<Session | undefined>;
}, res: ServerResponse) => Promise<Session>;
export type { Options, SessionStore } from "./types";

@@ -21,6 +21,3 @@ import { parse } from "cookie";

commitHeader(res, name, this, encode);
if (!session[isDestroyed]) {
await store.set(this.id, this);
}
await store.set(this.id, this);
}

@@ -50,3 +47,3 @@ },

return async function sessionHandle(req, res) {
if (req.session) return;
if (req.session) return req.session;

@@ -53,0 +50,0 @@ const _now = Date.now();

{
"type": "module",
"name": "next-session",
"version": "4.0.0",
"version": "4.0.1",
"description": "Simple promise-based session for Next.js",

@@ -6,0 +6,0 @@ "keywords": [

@@ -9,3 +9,3 @@ # next-session

Simple _promise-based_ session for [Next.js](https://github.com/zeit/next.js). Also works in [micro](https://github.com/zeit/micro) or [Node.js HTTP Server](https://nodejs.org/api/http.html), [Express](https://github.com/expressjs/express), and more.
Lightweight _promise-based_ session middleware for [Next.js](https://github.com/zeit/next.js). Also works in [micro](https://github.com/zeit/micro) or [Node.js HTTP Server](https://nodejs.org/api/http.html), [Express](https://github.com/expressjs/express), and more.

@@ -12,0 +12,0 @@ > Check out alternatives like [next-iron-session](https://github.com/vvo/next-iron-session) instead. Also check out [nextjs-mongodb-app](https://github.com/hoangvvo/nextjs-mongodb-app) to see this module in use.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc