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 5.8.3 to 5.9.0

6

History.md
5.9.0 / 2018-08-28
==================
**features**
* [[`7241400`](http://github.com/koajs/session/commit/724140076b65867b1a0cffee4f061971be8751c0)] - feat: Add autoCommit option (#139) (Jonas Galvez <<jonasgalvez@gmail.com>>)
5.8.3 / 2018-08-22

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

5

index.js

@@ -45,3 +45,5 @@ 'use strict';

} finally {
await sess.commit();
if (opts.autoCommit) {
await sess.commit();
}
}

@@ -71,2 +73,3 @@ };

if (opts.signed == null) opts.signed = true;
if (opts.autoCommit == null) opts.autoCommit = true;

@@ -73,0 +76,0 @@ debug('session options %j', opts);

2

lib/context.js

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

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

@@ -202,0 +202,0 @@

@@ -15,4 +15,5 @@ 'use strict';

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

@@ -115,4 +116,15 @@ this.isNew = true;

}
/**
* commit this session's headers if autoCommit is set to false
*
* @api public
*/
async manuallyCommit() {
await this._sessCtx.commit();
}
}
module.exports = Session;

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

"repository": "koajs/session",
"version": "5.8.3",
"version": "5.9.0",
"keywords": [

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

@@ -56,2 +56,3 @@ # koa-session

maxAge: 86400000,
autoCommit: true, /** (boolean) automatically commit headers (default true) */
overwrite: true, /** (boolean) can overwrite or not (default true) */

@@ -154,2 +155,6 @@ httpOnly: true, /** (boolean) httpOnly or not (default true) */

### Session#manuallyCommit()
Session headers are auto committed by default. Use this if `autoCommit` is set to `false`.
### Destroying a session

@@ -156,0 +161,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