use cookie to store session data

Usage no npm install needed!

<script type="module">
  import thinkSessionCookie from '';



Build Status Coverage Status npm

Use cookie to store session


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