Novel Preposterous Mockery

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

    1.1.4 • Public • Published

    think-session-file

    File session for ThinkJS

    Build Status Coverage Status npm

    Install

    npm install think-session-file
    

    How to use

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

    const fileSession = require('think-session-file');
    exports.session = {
      type: 'file',
      common: {
        cookie: {
          name: 'thinkjs',
          //maxAge: '',
          //expires: '',
          path: '/',  //a string indicating the path of the cookie
          //domain: '',
          //secure: false,
          //keys: [],
          httpOnly: true,
          sameSite: false,
          signed: false,
          overwrite: false
        }
      },
      file: {
        handle: fileSession,
        sessionPath: path.join(think.ROOT_PATH, 'runtime/session'), //file session store root path
        maxAge: '1d', //session timeout, default is 1 day
        autoUpdate: false, //update expires time when get session, default is false
      }
    }

    Keywords

    none

    Install

    npm i think-session-file

    DownloadsWeekly Downloads

    76

    Version

    1.1.4

    License

    none

    Unpacked Size

    15.3 kB

    Total Files

    8

    Last publish

    Collaborators

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