Home

Awesome

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',
  common: {
    maxAge: 24 * 3600 * 1000, // 1 day 
  },
  cookie: {
    handle: cookie
  }
}

session method

For each ctx, session is only instantiated once.