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

koa-session

Package Overview
Dependencies
Maintainers
8
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-session - npm Package Compare versions

Comparing version 6.1.0 to 6.2.0

6

History.md
6.2.0 / 2021-03-30
==================
**features**
* [[`7cde341`](http://github.com/koajs/session/commit/7cde341db1691ee6885eb1b11ff3a3a3632fd5ce)] - feat: add session.externalKey (#207) (Yiyu He <<dead_horse@qq.com>>)
6.1.0 / 2020-10-08

@@ -3,0 +9,0 @@ ==================

2

lib/context.js

@@ -207,3 +207,3 @@ 'use strict';

if (this.store) this.externalKey = externalKey || this.opts.genid && this.opts.genid(this.ctx);
this.session = new Session(this, val);
this.session = new Session(this, val, this.externalKey);
}

@@ -210,0 +210,0 @@

@@ -7,2 +7,4 @@ 'use strict';

const inspect = Symbol.for('nodejs.util.inspect.custom');
class Session {

@@ -16,5 +18,6 @@ /**

constructor(sessionContext, obj) {
constructor(sessionContext, obj, externalKey) {
this._sessCtx = sessionContext;
this._ctx = sessionContext.ctx;
this._externalKey = externalKey;
if (!obj) {

@@ -57,3 +60,3 @@ this.isNew = true;

inspect() {
[inspect]() {
return this.toJSON();

@@ -110,2 +113,10 @@ }

/**
* get session external key
* only exist if opts.store present
*/
get externalKey() {
return this._externalKey;
}
/**
* save this session no matter whether it is populated

@@ -112,0 +123,0 @@ *

@@ -5,3 +5,3 @@ {

"repository": "koajs/session",
"version": "6.1.0",
"version": "6.2.0",
"keywords": [

@@ -8,0 +8,0 @@ "koa",

@@ -163,2 +163,6 @@ # koa-session

### Session#externalKey
Get session external key, only exist when external session store present.
### Session#save()

@@ -165,0 +169,0 @@

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