think-session-cookie
TypeScript icon, indicating that this package has built-in type declarations

1.1.4 • Public • Published

think-session-cookie

Build Status Coverage Status npm

Use cookie to store session

Install

npm install think-session-cookie

How to use

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

const cookie = require('think-session-cookie');
exports.session = {
  type: 'cookie',
  common: {
    cookie: {
      name: 'thinkjs',
      autoUpdate: false, //auto update cookie when maxAge is set
      //maxAge: '',
      //expires: '',
      path: '/',  //a string indicating the path of the cookie
      //domain: '',
      //secure: false,
      //keys: [],
      httpOnly: true,
      sameSite: false,
      signed: false,
      overwrite: false
    }
  },
  cookie: {
    handle: cookie,
    cookie: {
      encrypt: false //encrypt cookie data
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i think-session-cookie

Weekly Downloads

8

Version

1.1.4

License

none

Unpacked Size

14.8 kB

Total Files

9

Last publish

Collaborators

  • lizheming
  • welefen
  • sijiecai
  • lushijie
  • berwin
  • bezos
  • toxicjohann
  • huangxiaolu
  • zhengqingxin