跳到主要内容
版本:Next

ISession

Indexable

[_: string]: any

Index

Properties

readonlylength

length: number

Return how many values there are in the session object. Used to see if it”s “populated”.

maxAge

maxAge: number | session

get/set session maxAge

readonlypopulated

populated: boolean

populated flag, which is just a boolean alias of .length.

Methods

manuallyCommit

  • manuallyCommit(): Promise<void>
  • commit this session’s headers if autoCommit is set to false.

regenerate

  • regenerate(callback?: () => void): void
  • regenerate this session

save

  • save(callback?: () => void): void
  • save this session no matter whether it is populated

toJSON

  • toJSON(): object
  • JSON representation of the session.