think-session-cookie
v1.1.4
Published
use cookie to store session data
Downloads
16
Keywords
Readme
think-session-cookie
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
}
}
}