1.0.2 • Published 5 years ago

think-session2 v1.0.2

Weekly downloads
17
License
-
Repository
github
Last release
5 years ago

think-session

Build Status Coverage Status npm

Session for ThinkJS 3.x.

Add session method for controller/context.

config

config file src/config/adapter.js, add options:

const cookie = require('think-session-cookie');
exports.session = {
  type: 'cookie',
  cookie: {
    handle: cookie
  }
}

session method

  • this.session() get all session data
  • this.session(name) get session data with name
  • this.session(name, value) set session data
  • this.session(null) delete all session data
  • this.session(name, undefined, options) get session data with options

For each ctx, session is only instantiated once.

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago